Table of Contents

Class HttpClientManagementConnection

Namespace
Auth0.ManagementApi
Assembly
Auth0.ManagementApi.dll
public class HttpClientManagementConnection : IManagementConnection, IDisposable
Inheritance
HttpClientManagementConnection
Implements
Inherited Members

Constructors

HttpClientManagementConnection(HttpClient, HttpClientManagementConnectionOptions)

Initializes a new instance of the HttpClientManagementConnection class.

public HttpClientManagementConnection(HttpClient httpClient = null, HttpClientManagementConnectionOptions options = null)

Parameters

httpClient HttpClient

Optional HttpClient to use. If not specified one will be created and be used for all requests made by this instance.

options HttpClientManagementConnectionOptions

Optional HttpClientManagementConnectionOptions to use.

HttpClientManagementConnection(HttpMessageHandler, HttpClientManagementConnectionOptions)

Initializes a new instance of the HttpClientManagementConnection class.

public HttpClientManagementConnection(HttpMessageHandler handler, HttpClientManagementConnectionOptions options = null)

Parameters

handler HttpMessageHandler

HttpMessageHandler to use with the managed HttpClient that will be created and used for all requests made by this instance.

options HttpClientManagementConnectionOptions

Optional HttpClientManagementConnectionOptions to use.

Methods

Dispose()

Disposes of any owned disposable resources such as the underlying HttpClient if owned.

public void Dispose()

Dispose(bool)

Disposes of any owned disposable resources such as the underlying HttpClient if owned.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

Whether we are actually disposing (true) or not (false).

GetAsync<T>(Uri, IDictionary<string, string>, JsonConverter[], CancellationToken)

Perform a HTTP GET operation against a given Uri and return the materialized response body as T.

public Task<T> GetAsync<T>(Uri uri, IDictionary<string, string> headers, JsonConverter[] converters = null, CancellationToken cancellationToken = default)

Parameters

uri Uri

Uri to perform the GET request against.

headers IDictionary<string, string>

Dictionary containing additional headers that may override the defaults.

converters JsonConverter[]

Optional array of Newtonsoft.Json.JsonConverters used to deserialize the resulting T.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<T>

Task representing the async operation containing response body as T.

Type Parameters

T

Type of object to deserialize the result content as.

SendAsync<T>(HttpMethod, Uri, object, IDictionary<string, string>, IList<FileUploadParameter>, JsonConverter[], CancellationToken)

Perform a HTTP operation against a given Uri and return any materialized response body as T.

public Task<T> SendAsync<T>(HttpMethod method, Uri uri, object body, IDictionary<string, string> headers, IList<FileUploadParameter> files = null, JsonConverter[] converters = null, CancellationToken cancellationToken = default)

Parameters

method HttpMethod

HttpMethod to use in performing the request.

uri Uri

Uri to perform the request against.

body object

Payload to send to the server. If specified as a Dictionary<string, string> then FormUrlEncodedContent is expected, otherwise StringContent containing the JSON representation of the object is expected.

headers IDictionary<string, string>

Dictionary containing additional headers that may override the defaults.

files IList<FileUploadParameter>

Optional IList<T> containing file contents to upload as a MultipartFormDataContent post.

converters JsonConverter[]

Optional array of Newtonsoft.Json.JsonConverters used to deserialize the resulting T.

cancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

Task<T>

Task representing the async operation containing response body as T.

Type Parameters

T

Type of object to deserialize the result content as.

Remarks

files can only be specified if body is a Dictionary%lt;string, object%gt;"/>.