public static async Task <string> GetAsync(Uri requestUri, RestfulClient HttpClient) { Task <string> task = HttpClient.GetStringAsync(requestUri); string msg = await task; return(msg); }
public static async Task PostAsync(Uri requestUri, string message, RestfulClient HttpClient) { HttpResponseMessage msg = await HttpClient.PostAsync(requestUri, new StringContent(message)); if (!msg.IsSuccessStatusCode) { throw new HttpRequestException(); } }