Class HttpClientManagementConnection
- Namespace
- Auth0.ManagementApi
- Assembly
- Auth0.ManagementApi.dll
Implements IManagementConnection using HttpClient.
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
httpClientHttpClientOptional HttpClient to use. If not specified one will be created and be used for all requests made by this instance.
optionsHttpClientManagementConnectionOptionsOptional HttpClientManagementConnectionOptions to use.
HttpClientManagementConnection(HttpMessageHandler, HttpClientManagementConnectionOptions)
Initializes a new instance of the HttpClientManagementConnection class.
public HttpClientManagementConnection(HttpMessageHandler handler, HttpClientManagementConnectionOptions options = null)
Parameters
handlerHttpMessageHandlerHttpMessageHandler to use with the managed HttpClient that will be created and used for all requests made by this instance.
optionsHttpClientManagementConnectionOptionsOptional 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
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
uriUriUri to perform the GET request against.
headersIDictionary<string, string>Dictionary containing additional headers that may override the defaults.
convertersJsonConverter[]Optional array of Newtonsoft.Json.JsonConverters used to deserialize the resulting
T.cancellationTokenCancellationTokenThe cancellation token to cancel operation.
Returns
Type Parameters
TType 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
methodHttpMethodHttpMethod to use in performing the request.
uriUriUri to perform the request against.
bodyobjectPayload 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.
headersIDictionary<string, string>Dictionary containing additional headers that may override the defaults.
filesIList<FileUploadParameter>Optional IList<T> containing file contents to upload as a MultipartFormDataContent post.
convertersJsonConverter[]Optional array of Newtonsoft.Json.JsonConverters used to deserialize the resulting
T.cancellationTokenCancellationTokenThe cancellation token to cancel operation.
Returns
Type Parameters
TType of object to deserialize the result content as.
Remarks
files can only be specified if body is a Dictionary%lt;string, object%gt;"/>.