Exemplo n.º 1
0
 /// <summary>读内容处理器_返回字符串</summary>
 private static async Task <object> ReadAsStringAsync(HttpClientWrapper client, HttpResponseMessage response)
 {
     return(await response.Content.ReadAsStringAsync().ConfigureAwait(false));
 }
Exemplo n.º 2
0
        /// <summary>读内容处理器</summary>
        private static async Task <object> ReadAsObjectAsync <T>(HttpClientWrapper client, HttpResponseMessage response)
        {
            var result = await ReadAsObjectAsync(client, response, typeof(T));

            return(result == null ? default(T) : result);
        }
Exemplo n.º 3
0
 /// <summary>读内容处理器_返回应答对象</summary>
 private static async Task <object> ReadAsSelfAsync(HttpClientWrapper client, HttpResponseMessage response)
 {
     return(await Task.FromResult(response));
 }
Exemplo n.º 4
0
 /// <summary>读内容处理器_根据MIME返回对象</summary>
 private static async Task <object> ReadAsObjectAsync(HttpClientWrapper client, HttpResponseMessage response)
 {
     return(await ReadAsObjectAsync(client, response, null));
 }