Table of Contents

Class StreamGetNetworkRequest

Namespace
MADE.Networking.Http.Requests.Streams
Assembly
MADE.Networking.dll

Defines a network request for a GET call with a data stream response.

public sealed class StreamGetNetworkRequest : NetworkRequest, INetworkRequest
Inheritance
StreamGetNetworkRequest
Implements
Inherited Members
Extension Methods

Constructors

StreamGetNetworkRequest(HttpClient, string)

Initializes a new instance of the StreamGetNetworkRequest class.

public StreamGetNetworkRequest(HttpClient client, string url)

Parameters

client HttpClient

The HttpClient for executing the request.

url string

The URL for the request.

StreamGetNetworkRequest(HttpClient, string, Dictionary<string, string>?)

Initializes a new instance of the StreamGetNetworkRequest class.

public StreamGetNetworkRequest(HttpClient client, string url, Dictionary<string, string>? headers)

Parameters

client HttpClient

The HttpClient for executing the request.

url string

The URL for the request.

headers Dictionary<string, string>

The additional headers.

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.