Interface IRequestExecutor
A low-level abstraction over HTTP that executes requests and returns responses.
Namespace: Okta.Sdk.Internal
Assembly: Okta.Sdk.dll
Syntax
public interface IRequestExecutor
Methods
DeleteAsync(String, IEnumerable<KeyValuePair<String, String>>, CancellationToken)
Sends a DELETE request to the specified href
.
Declaration
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
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
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
Task<HttpResponse<string>> PostAsync(HttpRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
HttpRequest | request | The request. |
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
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
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. |