HTTP API Toolkit HTTP API Toolkit
HTTP API Toolkit HTTP API Toolkit
DocFX + Singulink = ♥

Search Results for

    Method Create

    Create(string, long, Func<long, Memory<byte>, CancellationToken, ValueTask<int>>, string?)

    Creates a source whose reads call the specified function.

    Declaration
    public static UploadSource Create(string fileName, long length, Func<long, Memory<byte>, CancellationToken, ValueTask<int>> readAsync, string? contentType = null)
    Parameters
    Type Name Description
    string fileName

    The name of the file, which the service receives.

    long length

    The length of the content in bytes.

    Func<long, Memory<byte>, CancellationToken, ValueTask<int>> readAsync

    A function that reads bytes of the content from an offset into a buffer and returns how many it read, as ReadAsync(long, Memory<byte>, CancellationToken) does.

    string contentType

    The content type of the file, such as image/png, which the service receives. Default is null, which sends none.

    Returns
    Type Description
    UploadSource
    Exceptions
    Type Condition
    ArgumentException

    fileName is empty.

    ArgumentOutOfRangeException

    length is negative.

    © Singulink. All rights reserved.