private FluentHttpClientRequest(IFluentHttpClientRequestBuilder fluentHttpClientRequestBuilder, FluentHttpClient fluentHttpClient) { Message = fluentHttpClientRequestBuilder.Message; FluentHttpClient = fluentHttpClient; EnsureSuccessStatusCode = fluentHttpClientRequestBuilder.EnsureSuccessStatusCode; }
public static async Task <FluentHttpClientResponse> GetAsync(this FluentHttpClient fluentHttpClient, string uri) { var request = fluentHttpClient.CreateNewRequest().AsGet().WithUri(uri).Build(); return(await fluentHttpClient.SendAsync(request)); }
public FluentHttpClient Build() { if (_baseUrl == null) { _baseUrl = new Uri(""); } var fluentHttpClient = new FluentHttpClient(this) { RawHttpClient = BuildHttpClient(this) }; if (_middlewares == null || !_middlewares.Any()) { return(fluentHttpClient); } FluentHttpClientRequestDelegate invokeDelegate = fluentHttpClient.RawHttpClientSendAsync; _requestDelegate = CreateMiddlewares(invokeDelegate); ; return(fluentHttpClient); }
public FluentHttpClient Build() { var fluentHttpClient = new FluentHttpClient(this); fluentHttpClient.RawHttpClient = BuildHttpClient(this); return(fluentHttpClient); }
public static async Task <T> PatchAsync <T>(this FluentHttpClient fluentHttpClient, string uri, object body, MediaTypeHeaderValue contentType = null) { var request = fluentHttpClient.CreateNewRequest().AsPatch().WithUri(uri) .WithBody(body).Build(); var response = await fluentHttpClient.SendAsync <T>(request); return(response.Content); }
internal FluentHttpRequest(FluentHttpClient httpClient) { FluentHttpClient = httpClient; RequestFilters = new List <IFluentHttpRequestFilter>(); }
public static FluentHttpClientRequest.FluentHttpClientRequestBuilder CreateNewRequest( this FluentHttpClient fluentHttpClient) { return(FluentHttpClientRequest.CreateNewRequest(fluentHttpClient)); }
public static async Task <T> GetAsync <T>(this FluentHttpClient fluentHttpClient, string uri) { var response = await GetFluentAsync <T>(fluentHttpClient, uri); return(response.Content); }