Class TusHttpRequest
A class representing a request to be sent to a Tus enabled server.
Inherited Members
Namespace: Unity.Services.Ccd.Management
Assembly: Unity.Services.Ccd.Management.dll
Syntax
public class TusHttpRequest
Constructors
TusHttpRequest(string, RequestMethod, IDictionary<string, string>, ArraySegment<byte>, CancellationToken?)
Create a new request to be made against a Tus enabled server.
Declaration
public TusHttpRequest(string url, RequestMethod method, IDictionary<string, string> additionalHeaders = null, ArraySegment<byte> bodyBytes = default, CancellationToken? cancelToken = null)
Parameters
Type | Name | Description |
---|---|---|
string | url | The URL to make the request against. |
RequestMethod | method | The HTTP method to use for the request. |
IDictionary<string, string> | additionalHeaders | A Dictionary<TKey, TValue> of user specified headers to add to the request. |
ArraySegment<byte> | bodyBytes | A byte array of the content of the request. |
CancellationToken? | cancelToken | A CancellationToken to cancel the request with. |
Properties
BodyBytes
Get the raw bytes of the content of the request.
Declaration
public ArraySegment<byte> BodyBytes { get; }
Property Value
Type | Description |
---|---|
ArraySegment<byte> |
CancelToken
Get the cancellation token used to cancel the request.
Declaration
public CancellationToken CancelToken { get; }
Property Value
Type | Description |
---|---|
CancellationToken |
Headers
Get a read-only collection of the headers of the request.
Declaration
public IReadOnlyDictionary<string, string> Headers { get; }
Property Value
Type | Description |
---|---|
IReadOnlyDictionary<string, string> |
Method
Get the HTTP method of the request.
Declaration
public string Method { get; }
Property Value
Type | Description |
---|---|
string |
Url
Get the URL the request is being made against.
Declaration
public Uri Url { get; }
Property Value
Type | Description |
---|---|
Uri |
Methods
AddHeader(string, string)
Add an HTTP header to request.
Declaration
public void AddHeader(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
string | key | The name of the HTTP header. |
string | value | The value of the HTTP header. |
OnDownloadProgressed(long, long)
Invoke an DownloadProgressed event.
Declaration
public void OnDownloadProgressed(long bytesTransferred, long bytesTotal)
Parameters
Type | Name | Description |
---|---|---|
long | bytesTransferred | The number of bytes downloaded so far. |
long | bytesTotal | The total number of bytes to be downloaded. |
OnUploadProgressed(long, long)
Invoke an UploadProgressed event.
Declaration
public void OnUploadProgressed(long bytesTransferred, long bytesTotal)
Parameters
Type | Name | Description |
---|---|---|
long | bytesTransferred | The number of bytes uploaded so far. |
long | bytesTotal | The total number of bytes to be uploaded. |
Events
DownloadProgressed
Occurs when progress receiving the response is made.
Declaration
public event ProgressDelegate DownloadProgressed
Event Type
Type | Description |
---|---|
ProgressDelegate |
UploadProgressed
Occurs when progress sending the request is made.
Declaration
public event ProgressDelegate UploadProgressed
Event Type
Type | Description |
---|---|
ProgressDelegate |