API version:
Show / Hide Table of Contents

Class DefaultRequestExecutor

The default implementation of IRequestExecutor that uses System.Net.Http.

Inheritance
System.Object
DefaultRequestExecutor
Implements
IRequestExecutor
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Okta.Sdk.Internal
Assembly: Okta.Sdk.dll
Syntax
public sealed class DefaultRequestExecutor : IRequestExecutor

Constructors

DefaultRequestExecutor()

Initializes a new instance of the DefaultRequestExecutor class.

Declaration
protected DefaultRequestExecutor()

DefaultRequestExecutor(OktaClientConfiguration, HttpClient, ILogger, IRetryStrategy, IOAuthTokenProvider, IHttpRequestMessageProvider)

Initializes a new instance of the DefaultRequestExecutor class.

Declaration
public DefaultRequestExecutor(OktaClientConfiguration configuration, HttpClient httpClient, ILogger logger, IRetryStrategy retryStrategy = null, IOAuthTokenProvider oAuthTokenProvider = null, IHttpRequestMessageProvider httpRequestMessageProvider = null)
Parameters
Type Name Description
OktaClientConfiguration configuration

The client configuration.

System.Net.Http.HttpClient httpClient

The HTTP client to use, if any.

Microsoft.Extensions.Logging.ILogger logger

The logging interface.

IRetryStrategy retryStrategy

The retry strategy interface.

IOAuthTokenProvider oAuthTokenProvider

The OAuth token provider interface.

IHttpRequestMessageProvider httpRequestMessageProvider

Methods

DeleteAsync(String, IEnumerable<KeyValuePair<String, String>>, CancellationToken)

Sends a DELETE request to the specified href.

Declaration
public Task<HttpResponse<string>> DeleteAsync(string href, IEnumerable<KeyValuePair<string, string>> headers, CancellationToken cancellationToken)
Parameters
Type Name Description
System.String href

The request URL.

System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.String>> headers

The HTTP headers to add to the request.

System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task<HttpResponse<System.String>>

The HTTP response.

ExecuteRequestAsync(HttpRequest, CancellationToken)

Execute the specified request.

Declaration
public Task<HttpResponse<string>> ExecuteRequestAsync(HttpRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
HttpRequest request

The request to execute.

System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task<HttpResponse<System.String>>

The HTTP response.

GetAsync(String, IEnumerable<KeyValuePair<String, String>>, CancellationToken)

Sends a GET request to the specified href.

Declaration
public Task<HttpResponse<string>> GetAsync(string href, IEnumerable<KeyValuePair<string, string>> headers, CancellationToken cancellationToken)
Parameters
Type Name Description
System.String href

The request URL.

System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.String>> headers

The HTTP headers to add to the request.

System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task<HttpResponse<System.String>>

The HTTP response.

PostAsync(HttpRequest, CancellationToken)

Sends the specified POST request.

Declaration
public Task<HttpResponse<string>> PostAsync(HttpRequest httpRequest, CancellationToken cancellationToken)
Parameters
Type Name Description
HttpRequest httpRequest
System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task<HttpResponse<System.String>>

The HTTP response.

PostAsync(String, IEnumerable<KeyValuePair<String, String>>, String, CancellationToken)

Sends a POST request to the specified href.

Declaration
public Task<HttpResponse<string>> PostAsync(string href, IEnumerable<KeyValuePair<string, string>> headers, string body, CancellationToken cancellationToken)
Parameters
Type Name Description
System.String href

The request URL.

System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.String>> headers

The HTTP headers to add to the request.

System.String body

The serialized request body.

System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task<HttpResponse<System.String>>

The HTTP response.

PutAsync(String, IEnumerable<KeyValuePair<String, String>>, String, CancellationToken)

Sends a PUT request to the specified href.

Declaration
public Task<HttpResponse<string>> PutAsync(string href, IEnumerable<KeyValuePair<string, string>> headers, string body, CancellationToken cancellationToken)
Parameters
Type Name Description
System.String href

The request URL.

System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.String>> headers

The HTTP headers to add to the request.

System.String body

The serialized request body.

System.Threading.CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task<HttpResponse<System.String>>

The HTTP response.

Implements

IRequestExecutor
Back to top Copyright © 2021 Okta, Inc.
Generated with DocFx.