Ejemplo n.º 1
0
        public static Task <HttpResponseMessage> SendAsync(this ISpiderHttpClient client, string url, HttpMethod method, HttpContent content = null, Action <HttpRequestHeaders> header = null)
        {
            HttpRequestMessage request = new HttpRequestMessage(method, url);

            request.Content = content;
            header?.Invoke(request.Headers);
            return(client.SendAsync(request));
        }
Ejemplo n.º 2
0
 public static Task <HttpResponseMessage> GetAsync(this ISpiderHttpClient client, string url, Action <HttpRequestHeaders> header = null)
 {
     return(client.SendAsync(url, HttpMethod.Get, null, header));
 }
Ejemplo n.º 3
0
 public static Task <HttpResponseMessage> DeleteAsync(this ISpiderHttpClient client, string url, HttpContent content = null, Action <HttpRequestHeaders> header = null)
 {
     return(client.SendAsync(url, HttpMethod.Delete, content, header));
 }