Table of Contents

Interface IManagementConnection

Namespace
Auth0.ManagementApi
Assembly
Auth0.ManagementApi.dll

Interface for connectivity between ManagementApiClient and the remote server.

public interface IManagementConnection

Remarks

A default implementation of this using HttpClient is included as HttpClientManagementConnection. You should mock this interface to perform unit testing of code that uses ManagementApiClient.

Methods

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.

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.

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;"/>.