Added a user api handler, and improved portable ApiClient

This commit is contained in:
LukePulverenti Luke Pulverenti luke pulverenti
2012-09-07 21:33:49 -04:00
parent 23ea228079
commit c7b305ee2e
7 changed files with 446 additions and 11 deletions

View File

@@ -336,11 +336,24 @@ namespace MediaBrowser.ApiInteraction
}
/// <summary>
/// Gets weather information for the default location as set in configuration
/// Gets the default user
/// </summary>
public async Task<DTOUser> GetDefaultUserAsync()
{
string url = ApiUrl + "/defaultuser";
string url = ApiUrl + "/user";
using (Stream stream = await GetSerializedStreamAsync(url).ConfigureAwait(false))
{
return DeserializeFromStream<DTOUser>(stream);
}
}
/// <summary>
/// Gets a user by id
/// </summary>
public async Task<DTOUser> GetUserAsync(Guid id)
{
string url = ApiUrl + "/user?id=" + id.ToString();
using (Stream stream = await GetSerializedStreamAsync(url).ConfigureAwait(false))
{