Class JsonPutNetworkRequest
- Namespace
- MADE.Networking.Http.Requests.Json
- Assembly
- MADE.Networking.dll
Defines a network request for a PUT call with a JSON response.
public sealed class JsonPutNetworkRequest : NetworkRequest, INetworkRequest
- Inheritance
-
JsonPutNetworkRequest
- Implements
- Inherited Members
- Extension Methods
Constructors
JsonPutNetworkRequest(HttpClient, string)
Initializes a new instance of the JsonPutNetworkRequest class.
public JsonPutNetworkRequest(HttpClient client, string url)
Parameters
clientHttpClientThe HttpClient for executing the request.
urlstringThe URL for the request.
JsonPutNetworkRequest(HttpClient, string, string?)
Initializes a new instance of the JsonPutNetworkRequest class.
public JsonPutNetworkRequest(HttpClient client, string url, string? jsonData)
Parameters
clientHttpClientThe HttpClient for executing the request.
urlstringThe URL for the request.
jsonDatastringThe JSON data to put.
JsonPutNetworkRequest(HttpClient, string, string?, Dictionary<string, string>?)
Initializes a new instance of the JsonPutNetworkRequest class.
public JsonPutNetworkRequest(HttpClient client, string url, string? jsonData, Dictionary<string, string>? headers)
Parameters
clientHttpClientThe HttpClient for executing the request.
urlstringThe URL for the request.
jsonDatastringThe JSON data to put.
headersDictionary<string, string>The additional headers.
Properties
Data
Gets or sets the data.
public string? Data { get; set; }
Property Value
Methods
ExecuteAsync(Type, CancellationToken)
Executes the network request.
public override Task<object> ExecuteAsync(Type expectedResponse, CancellationToken cancellationToken = default)
Parameters
expectedResponseTypeThe type expected by the response of the request.
cancellationTokenCancellationTokenThe cancellation token.
Returns
ExecuteAsync<TResponse>(CancellationToken)
Executes the network request.
public override Task<TResponse> ExecuteAsync<TResponse>(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task<TResponse>
Returns the response of the request as the specified type.
Type Parameters
TResponseThe type of object returned from the request.