Show / Hide Table of Contents

    Class HttpManager

    Provides ways for sending HTTP requests and receiving HTTP responses from a resource identified by a URI. This class cannot be inherited.

    Inheritance
    System.Object
    HttpManager
    Implements
    System.IDisposable
    Namespace: Cuemon.Net.Http
    Assembly: Cuemon.Net.dll
    Syntax
    public sealed class HttpManager : IDisposable

    Constructors

    | Improve this Doc

    HttpManager(Action<HttpManagerOptions>)

    Initializes a new instance of the HttpManager class.

    Declaration
    public HttpManager(Action<HttpManagerOptions> setup = null)
    Parameters
    Type Name Description
    System.Action<HttpManagerOptions> setup

    The HttpManagerOptions which need to be configured.

    Properties

    | Improve this Doc

    DefaultRequestHeaders

    Gets the headers which should be sent with each request.

    Declaration
    public HttpRequestHeaders DefaultRequestHeaders { get; }
    Property Value
    Type Description
    System.Net.Http.Headers.HttpRequestHeaders

    The headers which should be sent with each request.

    | Improve this Doc

    Timeout

    Gets or sets the timespan to wait before the request times out.

    Declaration
    public TimeSpan Timeout { get; set; }
    Property Value
    Type Description
    System.TimeSpan

    The timespan to wait before the request times out.

    Methods

    | Improve this Doc

    Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

    Declaration
    public void Dispose()
    | Improve this Doc

    HttpAsync(HttpMethod, Uri, MediaTypeHeaderValue, Stream, CancellationToken)

    Send a request as an asynchronous operation.

    Declaration
    public Task<HttpResponseMessage> HttpAsync(HttpMethod method, Uri location, MediaTypeHeaderValue contentType, Stream content, CancellationToken ct = default(CancellationToken))
    Parameters
    Type Name Description
    System.Net.Http.HttpMethod method

    The HTTP method.

    System.Uri location

    The System.Uri to request.

    System.Net.Http.Headers.MediaTypeHeaderValue contentType

    The Content-Type header of the HTTP request sent to the server.

    System.IO.Stream content

    The HTTP request content sent to the server.

    System.Threading.CancellationToken ct

    The cancellation token to cancel operation.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>

    The task object representing the asynchronous operation.

    | Improve this Doc

    HttpAsync(HttpMethod, Uri, String, Stream, CancellationToken)

    Send a request as an asynchronous operation.

    Declaration
    public Task<HttpResponseMessage> HttpAsync(HttpMethod method, Uri location, string contentType, Stream content, CancellationToken ct = default(CancellationToken))
    Parameters
    Type Name Description
    System.Net.Http.HttpMethod method

    The HTTP method.

    System.Uri location

    The System.Uri to request.

    System.String contentType

    The Content-Type header of the HTTP request sent to the server.

    System.IO.Stream content

    The HTTP request content sent to the server.

    System.Threading.CancellationToken ct

    The cancellation token to cancel operation.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>

    The task object representing the asynchronous operation.

    | Improve this Doc

    HttpAsync(Uri, Action<HttpRequestOptions>)

    Send a request as an asynchronous operation.

    Declaration
    public Task<HttpResponseMessage> HttpAsync(Uri location, Action<HttpRequestOptions> setup)
    Parameters
    Type Name Description
    System.Uri location

    The System.Uri to request.

    System.Action<HttpRequestOptions> setup

    The HttpRequestOptions which need to be configured.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>

    The task object representing the asynchronous operation.

    | Improve this Doc

    HttpDeleteAsync(Uri, CancellationToken)

    Send a DELETE request to the specified Uri as an asynchronous operation.

    Declaration
    public Task<HttpResponseMessage> HttpDeleteAsync(Uri location, CancellationToken ct = default(CancellationToken))
    Parameters
    Type Name Description
    System.Uri location

    The System.Uri to request.

    System.Threading.CancellationToken ct

    The cancellation token to cancel operation.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>

    The task object representing the asynchronous operation.

    | Improve this Doc

    HttpGetAsync(Uri, CancellationToken)

    Send a GET request to the specified Uri as an asynchronous operation.

    Declaration
    public Task<HttpResponseMessage> HttpGetAsync(Uri location, CancellationToken ct = default(CancellationToken))
    Parameters
    Type Name Description
    System.Uri location

    The System.Uri to request.

    System.Threading.CancellationToken ct

    The cancellation token to cancel operation.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>

    The task object representing the asynchronous operation.

    | Improve this Doc

    HttpHeadAsync(Uri, CancellationToken)

    Send a HEAD request to the specified Uri as an asynchronous operation.

    Declaration
    public Task<HttpResponseMessage> HttpHeadAsync(Uri location, CancellationToken ct = default(CancellationToken))
    Parameters
    Type Name Description
    System.Uri location

    The System.Uri to request.

    System.Threading.CancellationToken ct

    The cancellation token to cancel operation.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>

    The task object representing the asynchronous operation.

    | Improve this Doc

    HttpOptionsAsync(Uri, CancellationToken)

    Send an OPTIONS request to the specified Uri as an asynchronous operation.

    Declaration
    public Task<HttpResponseMessage> HttpOptionsAsync(Uri location, CancellationToken ct = default(CancellationToken))
    Parameters
    Type Name Description
    System.Uri location

    The System.Uri to request.

    System.Threading.CancellationToken ct

    The cancellation token to cancel operation.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>

    The task object representing the asynchronous operation.

    | Improve this Doc

    HttpPatchAsync(Uri, MediaTypeHeaderValue, Stream, CancellationToken)

    Send a PATCH request to the specified Uri as an asynchronous operation.

    Declaration
    public Task<HttpResponseMessage> HttpPatchAsync(Uri location, MediaTypeHeaderValue contentType, Stream content, CancellationToken ct = default(CancellationToken))
    Parameters
    Type Name Description
    System.Uri location

    The System.Uri to request.

    System.Net.Http.Headers.MediaTypeHeaderValue contentType

    The Content-Type header of the HTTP request sent to the server.

    System.IO.Stream content

    The HTTP request content sent to the server.

    System.Threading.CancellationToken ct

    The cancellation token to cancel operation.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>

    The task object representing the asynchronous operation.

    | Improve this Doc

    HttpPatchAsync(Uri, String, Stream, CancellationToken)

    Send a PATCH request to the specified Uri as an asynchronous operation.

    Declaration
    public Task<HttpResponseMessage> HttpPatchAsync(Uri location, string contentType, Stream content, CancellationToken ct = default(CancellationToken))
    Parameters
    Type Name Description
    System.Uri location

    The System.Uri to request.

    System.String contentType

    The Content-Type header of the HTTP request sent to the server.

    System.IO.Stream content

    The HTTP request content sent to the server.

    System.Threading.CancellationToken ct

    The cancellation token to cancel operation.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>

    The task object representing the asynchronous operation.

    | Improve this Doc

    HttpPostAsync(Uri, MediaTypeHeaderValue, Stream, CancellationToken)

    Send a POST request to the specified Uri as an asynchronous operation.

    Declaration
    public Task<HttpResponseMessage> HttpPostAsync(Uri location, MediaTypeHeaderValue contentType, Stream content, CancellationToken ct = default(CancellationToken))
    Parameters
    Type Name Description
    System.Uri location

    The System.Uri to request.

    System.Net.Http.Headers.MediaTypeHeaderValue contentType

    The Content-Type header of the HTTP request sent to the server.

    System.IO.Stream content

    The HTTP request content sent to the server.

    System.Threading.CancellationToken ct

    The cancellation token to cancel operation.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>

    The task object representing the asynchronous operation.

    | Improve this Doc

    HttpPostAsync(Uri, String, Stream, CancellationToken)

    Send a POST request to the specified Uri as an asynchronous operation.

    Declaration
    public Task<HttpResponseMessage> HttpPostAsync(Uri location, string contentType, Stream content, CancellationToken ct = default(CancellationToken))
    Parameters
    Type Name Description
    System.Uri location

    The System.Uri to request.

    System.String contentType

    The Content-Type header of the HTTP request sent to the server.

    System.IO.Stream content

    The HTTP request content sent to the server.

    System.Threading.CancellationToken ct

    The cancellation token to cancel operation.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>

    The task object representing the asynchronous operation.

    | Improve this Doc

    HttpPutAsync(Uri, MediaTypeHeaderValue, Stream, CancellationToken)

    Send a PUT request to the specified Uri as an asynchronous operation.

    Declaration
    public Task<HttpResponseMessage> HttpPutAsync(Uri location, MediaTypeHeaderValue contentType, Stream content, CancellationToken ct = default(CancellationToken))
    Parameters
    Type Name Description
    System.Uri location

    The System.Uri to request.

    System.Net.Http.Headers.MediaTypeHeaderValue contentType

    The Content-Type header of the HTTP request sent to the server.

    System.IO.Stream content

    The HTTP request content sent to the server.

    System.Threading.CancellationToken ct

    The cancellation token to cancel operation.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>

    The task object representing the asynchronous operation.

    | Improve this Doc

    HttpPutAsync(Uri, String, Stream, CancellationToken)

    Send a PUT request to the specified Uri as an asynchronous operation.

    Declaration
    public Task<HttpResponseMessage> HttpPutAsync(Uri location, string contentType, Stream content, CancellationToken ct = default(CancellationToken))
    Parameters
    Type Name Description
    System.Uri location

    The System.Uri to request.

    System.String contentType

    The Content-Type header of the HTTP request sent to the server.

    System.IO.Stream content

    The HTTP request content sent to the server.

    System.Threading.CancellationToken ct

    The cancellation token to cancel operation.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>

    The task object representing the asynchronous operation.

    | Improve this Doc

    HttpTraceAsync(Uri, CancellationToken)

    Send a TRACE request to the specified Uri as an asynchronous operation.

    Declaration
    public Task<HttpResponseMessage> HttpTraceAsync(Uri location, CancellationToken ct = default(CancellationToken))
    Parameters
    Type Name Description
    System.Uri location

    The System.Uri to request.

    System.Threading.CancellationToken ct

    The cancellation token to cancel operation.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>

    The task object representing the asynchronous operation.

    Implements

    System.IDisposable

    Extension Methods

    ConverterExtensions.ParseWith<TSource, TResult>(TSource, Func<TSource, TResult>)
    ConverterExtensions.ParseWith<TSource, T, TResult>(TSource, Func<TSource, T, TResult>, T)
    ConverterExtensions.ParseWith<TSource, T1, T2, TResult>(TSource, Func<TSource, T1, T2, TResult>, T1, T2)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, TResult>(TSource, Func<TSource, T1, T2, T3, TResult>, T1, T2, T3)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, TResult>(TSource, Func<TSource, T1, T2, T3, T4, TResult>, T1, T2, T3, T4)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, TResult>, T1, T2, T3, T4, T5)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, TResult>, T1, T2, T3, T4, T5, T6)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, T7, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, T7, TResult>, T1, T2, T3, T4, T5, T6, T7)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, T7, T8, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, T7, T8, TResult>, T1, T2, T3, T4, T5, T6, T7, T8)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>, T1, T2, T3, T4, T5, T6, T7, T8, T9)
    ConverterExtensions.As<TResult>(Object)
    ConverterExtensions.As<TResult>(Object, TResult)
    ConverterExtensions.As<TResult>(Object, TResult, IFormatProvider)
    DelegateUtilityExtensions.Wrap<TResult>(TResult)
    DelegateUtilityExtensions.DynamicWrap<TResult>(TResult)
    TweakerExtensions.Adjust<T>(T, Func<T, T>)
    TypeUtilityExtensions.Is<T>(Object)
    TypeUtilityExtensions.IsNot<T>(Object)
    TypeUtilityExtensions.IsNullable<T>(T)
    WrapperExtensions.UseWrapper<T>(T, Action<IDictionary<String, Object>>)
    WrapperExtensions.UseWrapper<T>(T, MemberInfo, Action<IDictionary<String, Object>>)
    EnumerableUtilityExtensions.Yield<TSource>(TSource)
    HashUtilityExtensions.ComputeHash(Object, Action<HashOptions>)
    HmacUtilityExtensions.ComputeKeyedHash(Object, Byte[], Action<KeyedHashOptions>)

    See Also

    System.IDisposable
    • Improve this Doc
    • View Source
    Back to top Copyright 2008-2018 Weubphoria. All rights reserved.
    Generated by DocFX