docs.unity3d.com
    Show / Hide Table of Contents

    Class TusHttpRequest

    A class representing a request to be sent to a Tus enabled server.

    Inheritance
    Object
    TusHttpRequest
    Namespace: Unity.Services.Ccd.Management
    Syntax
    public class TusHttpRequest : object

    Constructors

    TusHttpRequest(String, RequestMethod, IDictionary<String, String>, ArraySegment<Byte>, Nullable<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 = null, 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 of user specified headers to add to the request.

    ArraySegment<Byte> bodyBytes

    A byte array of the content of the request.

    Nullable<CancellationToken> cancelToken

    A 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(Int64, Int64)

    Invoke an DownloadProgressed event.

    Declaration
    public void OnDownloadProgressed(long bytesTransferred, long bytesTotal)
    Parameters
    Type Name Description
    Int64 bytesTransferred

    The number of bytes downloaded so far.

    Int64 bytesTotal

    The total number of bytes to be downloaded.

    OnUploadProgressed(Int64, Int64)

    Invoke an UploadProgressed event.

    Declaration
    public void OnUploadProgressed(long bytesTransferred, long bytesTotal)
    Parameters
    Type Name Description
    Int64 bytesTransferred

    The number of bytes uploaded so far.

    Int64 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
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023