public static async Task PutAsync <T>(RestUrl api, T putObject) where T : class { using (var client = GetClient(api.Base)) { var response = await client.PutAsync(api.Route, putObject, new JsonMediaTypeFormatter()).ConfigureAwait(false); response.EnsureSuccessStatusCode(); } }
public static async Task DeleteAsync(RestUrl api) { using (var client = GetClient(api.Base)) { var response = await client.DeleteAsync(api.Route).ConfigureAwait(false); response.EnsureSuccessStatusCode(); } }
public static async Task <T> GetAllAsync <T>(RestUrl api) where T : class { using (var client = GetClient(api.Base)) { var response = await client.GetAsync(api.Route).ConfigureAwait(false); response.EnsureSuccessStatusCode(); return(await ProceedResponse <T>(response)); } }