Example #1
0
        public static async Task <TResult> PutAsFormAsync <TResult>(this System.Net.Http.HttpClient httpClient, string url, object data = null)
        {
            var response = await httpClient.PutAsFormAsync(url, data);

            if (!response.IsSuccessStatusCode)
            {
                throw new HttpRequestException(JsonSerializer.Serialize(response));
            }

            return(await response.ReadContentAsync <TResult>());
        }