Table of Contents

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

client HttpClient

The HttpClient for executing the request.

url string

The 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

client HttpClient

The HttpClient for executing the request.

url string

The URL for the request.

jsonData string

The 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

client HttpClient

The HttpClient for executing the request.

url string

The URL for the request.

jsonData string

The JSON data to put.

headers Dictionary<string, string>

The additional headers.

Properties

Data

Gets or sets the data.

public string? Data { get; set; }

Property Value

string

Methods

ExecuteAsync(Type, CancellationToken)

Executes the network request.

public override Task<object> ExecuteAsync(Type expectedResponse, CancellationToken cancellationToken = default)

Parameters

expectedResponse Type

The type expected by the response of the request.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<object>

Returns the response of the request as an object.

ExecuteAsync<TResponse>(CancellationToken)

Executes the network request.

public override Task<TResponse> ExecuteAsync<TResponse>(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The cancellation token.

Returns

Task<TResponse>

Returns the response of the request as the specified type.

Type Parameters

TResponse

The type of object returned from the request.