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)); }
public static Task <HttpResponseMessage> GetAsync(this ISpiderHttpClient client, string url, Action <HttpRequestHeaders> header = null) { return(client.SendAsync(url, HttpMethod.Get, null, header)); }
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)); }