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
clientHttpClientThe HttpClient for executing the request.
urlstringThe 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
clientHttpClientThe HttpClient for executing the request.
urlstringThe URL for the request.
headersDictionary<string, string>The additional headers.
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.