HTTP API Toolkit HTTP API Toolkit
HTTP API Toolkit HTTP API Toolkit
DocFX + Singulink = ♥

Search Results for

    Method SendAsync

    SendAsync(HttpRequestMessage, CancellationToken)

    Sends an API request.

    Declaration
    protected Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    HttpRequestMessage request
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    Exceptions
    Type Condition
    HttpRequestException

    An error occurred while sending the request.

    BadRequestApiException

    A 400 (Bad Request) response was returned.

    UnauthorizedApiException

    A 401 (Unauthorized) response was returned.

    ForbiddenApiException

    A 403 (Forbidden) response was returned.

    NotFoundApiException

    A 404 (Not Found) response was returned.

    UserChangedApiException

    A 412 (Precondition Failed) response was returned.

    ValidationApiException

    A 422 (Unprocessable Content/Entity) response was returned.

    UserRequiredApiException

    A 428 (Precondition Required) response was returned.

    ApiException

    A response other than 2xx or one of the other known/expected error codes was returned.

    SendAsync(HttpRequestMessage, object?, CancellationToken)

    Sends an API request with the specified content.

    Declaration
    protected Task SendAsync(HttpRequestMessage request, object? content, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    HttpRequestMessage request
    object content
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    Exceptions
    Type Condition
    HttpRequestException

    An error occurred while sending the request.

    BadRequestApiException

    A 400 (Bad Request) response was returned.

    UnauthorizedApiException

    A 401 (Unauthorized) response was returned.

    ForbiddenApiException

    A 403 (Forbidden) response was returned.

    NotFoundApiException

    A 404 (Not Found) response was returned.

    UserChangedApiException

    A 412 (Precondition Failed) response was returned.

    ValidationApiException

    A 422 (Unprocessable Content/Entity) response was returned.

    UserRequiredApiException

    A 428 (Precondition Required) response was returned.

    ApiException

    A response other than 2xx or one of the other known/expected error codes was returned.

    SendAsync<TResponse>(HttpRequestMessage, CancellationToken)

    Sends an API request and returns the response.

    Declaration
    protected Task<TResponse> SendAsync<TResponse>(HttpRequestMessage request, CancellationToken cancellationToken = default) where TResponse : notnull
    Parameters
    Type Name Description
    HttpRequestMessage request
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<TResponse>
    Type Parameters
    Name Description
    TResponse
    Exceptions
    Type Condition
    HttpRequestException

    An error occurred while sending the request.

    BadRequestApiException

    A 400 (Bad Request) response was returned.

    UnauthorizedApiException

    A 401 (Unauthorized) response was returned.

    ForbiddenApiException

    A 403 (Forbidden) response was returned.

    NotFoundApiException

    A 404 (Not Found) response was returned.

    UserChangedApiException

    A 412 (Precondition Failed) response was returned.

    ValidationApiException

    A 422 (Unprocessable Content/Entity) response was returned.

    UserRequiredApiException

    A 428 (Precondition Required) response was returned.

    ApiException

    A response other than 2xx or one of the other known/expected error codes was returned.

    SendAsync<TResponse>(HttpRequestMessage, object?, CancellationToken)

    Sends an API request with the specified content and returns the response.

    Declaration
    [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "The trimming requirement is enforced on the reflection-based constructors via RequiresUnreferencedCode. The trim-safe constructors supply a source-generated IJsonTypeInfoResolver, so no unreferenced code is used at runtime.")]
    protected virtual Task<TResponse> SendAsync<TResponse>(HttpRequestMessage request, object? content, CancellationToken cancellationToken = default) where TResponse : notnull
    Parameters
    Type Name Description
    HttpRequestMessage request
    object content
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<TResponse>
    Type Parameters
    Name Description
    TResponse
    Exceptions
    Type Condition
    HttpRequestException

    An error occurred while sending the request.

    BadRequestApiException

    A 400 (Bad Request) response was returned.

    UnauthorizedApiException

    A 401 (Unauthorized) response was returned.

    ForbiddenApiException

    A 403 (Forbidden) response was returned.

    NotFoundApiException

    A 404 (Not Found) response was returned.

    UserChangedApiException

    A 412 (Precondition Failed) response was returned.

    ValidationApiException

    A 422 (Unprocessable Content/Entity) response was returned.

    UserRequiredApiException

    A 428 (Precondition Required) response was returned.

    ApiException

    A response other than 2xx or one of the other known/expected error codes was returned.

    © Singulink. All rights reserved.