Search Results for

    Show / Hide Table of Contents

    Class ApiClient

    Provides a default implementation of an Api client (both synchronous and asynchronous implementations), encapsulating general REST accessor use cases.

    Inheritance
    object
    ApiClient
    Implements
    ISynchronousClient
    IAsynchronousClient
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: mailslurp.Client
    Assembly: mailslurp.dll
    Syntax
    public class ApiClient : ISynchronousClient, IAsynchronousClient

    Constructors

    View Source

    ApiClient()

    Initializes a new instance of the ApiClient, defaulting to the global configurations' base url.

    Declaration
    public ApiClient()
    View Source

    ApiClient(string)

    Initializes a new instance of the ApiClient

    Declaration
    public ApiClient(string basePath)
    Parameters
    Type Name Description
    string basePath

    The target service's base path in URL format.

    Exceptions
    Type Condition
    System.ArgumentException

    Properties

    View Source

    SerializerSettings

    Specifies the settings on a Newtonsoft.Json.JsonSerializer object. These settings can be adjusted to accommodate custom serialization rules.

    Declaration
    public JsonSerializerSettings SerializerSettings { get; set; }
    Property Value
    Type Description
    Newtonsoft.Json.JsonSerializerSettings

    Methods

    View Source

    Delete<T>(string, RequestOptions, IReadableConfiguration)

    Make a HTTP DELETE request (synchronous).

    Declaration
    public ApiResponse<T> Delete<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
    Parameters
    Type Name Description
    string path

    The target path (or resource).

    RequestOptions options

    The additional request options.

    IReadableConfiguration configuration

    A per-request configuration object. It is assumed that any merge with GlobalConfiguration has been done before calling this method.

    Returns
    Type Description
    ApiResponse<T>

    A Task containing ApiResponse

    Type Parameters
    Name Description
    T
    View Source

    DeleteAsync<T>(string, RequestOptions, IReadableConfiguration, CancellationToken)

    Make a HTTP DELETE request (async).

    Declaration
    public Task<ApiResponse<T>> DeleteAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string path

    The target path (or resource).

    RequestOptions options

    The additional request options.

    IReadableConfiguration configuration

    A per-request configuration object. It is assumed that any merge with GlobalConfiguration has been done before calling this method.

    CancellationToken cancellationToken

    Token that enables callers to cancel the request.

    Returns
    Type Description
    Task<ApiResponse<T>>

    A Task containing ApiResponse

    Type Parameters
    Name Description
    T
    View Source

    Get<T>(string, RequestOptions, IReadableConfiguration)

    Make a HTTP GET request (synchronous).

    Declaration
    public ApiResponse<T> Get<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
    Parameters
    Type Name Description
    string path

    The target path (or resource).

    RequestOptions options

    The additional request options.

    IReadableConfiguration configuration

    A per-request configuration object. It is assumed that any merge with GlobalConfiguration has been done before calling this method.

    Returns
    Type Description
    ApiResponse<T>

    A Task containing ApiResponse

    Type Parameters
    Name Description
    T
    View Source

    GetAsync<T>(string, RequestOptions, IReadableConfiguration, CancellationToken)

    Make a HTTP GET request (async).

    Declaration
    public Task<ApiResponse<T>> GetAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string path

    The target path (or resource).

    RequestOptions options

    The additional request options.

    IReadableConfiguration configuration

    A per-request configuration object. It is assumed that any merge with GlobalConfiguration has been done before calling this method.

    CancellationToken cancellationToken

    Token that enables callers to cancel the request.

    Returns
    Type Description
    Task<ApiResponse<T>>

    A Task containing ApiResponse

    Type Parameters
    Name Description
    T
    View Source

    Head<T>(string, RequestOptions, IReadableConfiguration)

    Make a HTTP HEAD request (synchronous).

    Declaration
    public ApiResponse<T> Head<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
    Parameters
    Type Name Description
    string path

    The target path (or resource).

    RequestOptions options

    The additional request options.

    IReadableConfiguration configuration

    A per-request configuration object. It is assumed that any merge with GlobalConfiguration has been done before calling this method.

    Returns
    Type Description
    ApiResponse<T>

    A Task containing ApiResponse

    Type Parameters
    Name Description
    T
    View Source

    HeadAsync<T>(string, RequestOptions, IReadableConfiguration, CancellationToken)

    Make a HTTP HEAD request (async).

    Declaration
    public Task<ApiResponse<T>> HeadAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string path

    The target path (or resource).

    RequestOptions options

    The additional request options.

    IReadableConfiguration configuration

    A per-request configuration object. It is assumed that any merge with GlobalConfiguration has been done before calling this method.

    CancellationToken cancellationToken

    Token that enables callers to cancel the request.

    Returns
    Type Description
    Task<ApiResponse<T>>

    A Task containing ApiResponse

    Type Parameters
    Name Description
    T
    View Source

    Options<T>(string, RequestOptions, IReadableConfiguration)

    Make a HTTP OPTION request (synchronous).

    Declaration
    public ApiResponse<T> Options<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
    Parameters
    Type Name Description
    string path

    The target path (or resource).

    RequestOptions options

    The additional request options.

    IReadableConfiguration configuration

    A per-request configuration object. It is assumed that any merge with GlobalConfiguration has been done before calling this method.

    Returns
    Type Description
    ApiResponse<T>

    A Task containing ApiResponse

    Type Parameters
    Name Description
    T
    View Source

    OptionsAsync<T>(string, RequestOptions, IReadableConfiguration, CancellationToken)

    Make a HTTP OPTION request (async).

    Declaration
    public Task<ApiResponse<T>> OptionsAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string path

    The target path (or resource).

    RequestOptions options

    The additional request options.

    IReadableConfiguration configuration

    A per-request configuration object. It is assumed that any merge with GlobalConfiguration has been done before calling this method.

    CancellationToken cancellationToken

    Token that enables callers to cancel the request.

    Returns
    Type Description
    Task<ApiResponse<T>>

    A Task containing ApiResponse

    Type Parameters
    Name Description
    T
    View Source

    Patch<T>(string, RequestOptions, IReadableConfiguration)

    Make a HTTP PATCH request (synchronous).

    Declaration
    public ApiResponse<T> Patch<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
    Parameters
    Type Name Description
    string path

    The target path (or resource).

    RequestOptions options

    The additional request options.

    IReadableConfiguration configuration

    A per-request configuration object. It is assumed that any merge with GlobalConfiguration has been done before calling this method.

    Returns
    Type Description
    ApiResponse<T>

    A Task containing ApiResponse

    Type Parameters
    Name Description
    T
    View Source

    PatchAsync<T>(string, RequestOptions, IReadableConfiguration, CancellationToken)

    Make a HTTP PATCH request (async).

    Declaration
    public Task<ApiResponse<T>> PatchAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string path

    The target path (or resource).

    RequestOptions options

    The additional request options.

    IReadableConfiguration configuration

    A per-request configuration object. It is assumed that any merge with GlobalConfiguration has been done before calling this method.

    CancellationToken cancellationToken

    Token that enables callers to cancel the request.

    Returns
    Type Description
    Task<ApiResponse<T>>

    A Task containing ApiResponse

    Type Parameters
    Name Description
    T
    View Source

    Post<T>(string, RequestOptions, IReadableConfiguration)

    Make a HTTP POST request (synchronous).

    Declaration
    public ApiResponse<T> Post<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
    Parameters
    Type Name Description
    string path

    The target path (or resource).

    RequestOptions options

    The additional request options.

    IReadableConfiguration configuration

    A per-request configuration object. It is assumed that any merge with GlobalConfiguration has been done before calling this method.

    Returns
    Type Description
    ApiResponse<T>

    A Task containing ApiResponse

    Type Parameters
    Name Description
    T
    View Source

    PostAsync<T>(string, RequestOptions, IReadableConfiguration, CancellationToken)

    Make a HTTP POST request (async).

    Declaration
    public Task<ApiResponse<T>> PostAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string path

    The target path (or resource).

    RequestOptions options

    The additional request options.

    IReadableConfiguration configuration

    A per-request configuration object. It is assumed that any merge with GlobalConfiguration has been done before calling this method.

    CancellationToken cancellationToken

    Token that enables callers to cancel the request.

    Returns
    Type Description
    Task<ApiResponse<T>>

    A Task containing ApiResponse

    Type Parameters
    Name Description
    T
    View Source

    Put<T>(string, RequestOptions, IReadableConfiguration)

    Make a HTTP PUT request (synchronous).

    Declaration
    public ApiResponse<T> Put<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
    Parameters
    Type Name Description
    string path

    The target path (or resource).

    RequestOptions options

    The additional request options.

    IReadableConfiguration configuration

    A per-request configuration object. It is assumed that any merge with GlobalConfiguration has been done before calling this method.

    Returns
    Type Description
    ApiResponse<T>

    A Task containing ApiResponse

    Type Parameters
    Name Description
    T
    View Source

    PutAsync<T>(string, RequestOptions, IReadableConfiguration, CancellationToken)

    Make a HTTP PUT request (async).

    Declaration
    public Task<ApiResponse<T>> PutAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string path

    The target path (or resource).

    RequestOptions options

    The additional request options.

    IReadableConfiguration configuration

    A per-request configuration object. It is assumed that any merge with GlobalConfiguration has been done before calling this method.

    CancellationToken cancellationToken

    Token that enables callers to cancel the request.

    Returns
    Type Description
    Task<ApiResponse<T>>

    A Task containing ApiResponse

    Type Parameters
    Name Description
    T

    Implements

    ISynchronousClient
    IAsynchronousClient
    • View Source
    In This Article
    Back to top See MailSlurp website for more information.