-
Notifications
You must be signed in to change notification settings - Fork 1
Base Classes
TypNull edited this page May 8, 2024
·
1 revision
This class is designed to instantiate an HttpGet object that sends HTTP GET requests to a server and receives responses via the HttpClient. The primary instance of System.Net.Http.HttpClient is utilized here. This instance is responsible for managing HttpRequests for any IRequest that uses it.
-
staticHttpClient: Type:HttpClient- Primary instance of HttpClient.
-
Range: Type:
LoadRange- Gets or sets the primary download range of the HTTP GET request.
-
SecondRange: Type:
LoadRange- Sets a secondary range. The values between the primary and secondary ranges will be set as the new primary range.
-
Timeout: Type:
Nullable<TimeSpan>- Gets or sets the timeout for the HTTP GET request.
-
Token: Type:
CancellationToken- Gets the cancellation token for this HTTP GET request.
-
HeadRequestException: Type:
Nullable<Exception>- Gets the exception if the HEAD request failed.
-
FullContentLength: Type:
Nullable<long>- Gets the full content length of the response.
-
PartialContentLength: Type:
Nullable<long>- Gets the length of the part of the content that will be received when the range is set.
-
Constructor:
- Initializes a new instance of the HttpGet class.
-
SetContentLength: Type:
void- Sets the content length for the HTTP GET request.
-
Dispose: Type:
void- Disposes this object and suppresses finalization.
-
AddBytesToStart: Type:
void- Adds a specified value to the start of the range for the request. The start value does not change.
-
IsPartial: Type:
bool- Checks if the last request was partial.
-
HasToBePartial: Type:
bool- Determines if the next request should be partial.
-
privateLoadContentLength: Type:long- Initializes the lazy _contentLength. This method is called only once.
-
privateGetContentLength: Type:long- Retrieves the content length from the server.
-
public asyncLoadResponseAsync: Type:Task- Creates an instance of HttpResponseMessage.
-
privateIsLengthSet: Type:bool- Checks if the content length is set.
-
private asyncTask SendHttpMenssage: Type:Task- Sends an HTTP request message.
-
privateUpdateContentLength: Type:void- Updates the content length based on the response.
-
privateTimedTokenOrDefault: Type:CancellationToken- Gets a cancellation token with a timeout if one is set; otherwise, gets the default cancellation token.
-
privateInitAddToStart: Type:void- Initializes the start of the range.
-
privateSetRange: Type:void- Sets the range and second range of Options to a fitting value for the request.
-
private staticCloneRequestMessage: Type:HttpRequestMessage- Clones a HttpRequestMessage.
Represents a range of data to be loaded. This could be an absolute range (in bytes), a relative range (in parts), or a promille range.
-
Length: Type:
Nullable<long>- Gets the length of the LoadRange.
-
Start: Type:
Nullable<long>- Gets the start point of the LoadRange in bytes. This value is zero-based.
-
End: Type:
Nullable<long>- Gets the end point of the LoadRange in bytes. This value is zero-based.
-
IsAbsolut: Type:
bool- Indicates whether the values of the LoadRange are absolute.
-
IsPromille: Type:
bool- Indicates whether the values of the LoadRange are promille values between 0 and 1000.
-
LoadRange: Type:
void- Initializes a new instance of the LoadRange struct with absolute start and end values.
-
LoadRange: Type:
void- Initializes a new instance of the LoadRange struct with a relative range based on the part and total length.
-
LoadRange: Type:
void- Initializes a new instance of the LoadRange struct with a promille range.
-
IsEmpty: Type:
bool- Indicates whether the LoadRange object is empty.
-
staticToAbsolut: Type:LoadRange- Converts a relative LoadRange to an absolute range, based on the given total length.