RESTCLIENT.NET
Menu
EN
↗ GitHub

RESTCLIENT.NET / API REFERENCE

RestClient.Net.Utilities.ProgressReportingHttpContent

All API types · RestClient.Net · View source

public class ProgressReportingHttpContent : HttpContent

Represents an HTTP content type that reports progress during upload and download operations.

Members

.ctor

public ProgressReportingHttpContent(byte[] data, int bufferSize = DefaultBufferSize, Action<long, long>? progress = null, string contentType = "application/octet-stream");

Initializes a new instance of the ProgressReportingHttpContent class using a byte array as content.

Parameter Type Default Description
data byte[] Required The byte array containing the content to be sent.
bufferSize int DefaultBufferSize The size of the buffer used for reading the content. Default is 8192 bytes.
progress Action<long, long>? null Optional callback to report progress during transfer. Receives current bytes and total bytes.
contentType string "application/octet-stream" The MIME type of the content. Defaults to "application/octet-stream".

View source: RestClient.Net/Utilities/ProgressReportingHttpContent.cs:45

.ctor

public ProgressReportingHttpContent(Stream content, int bufferSize = DefaultBufferSize, string contentType = "application/octet-stream", Action<long, long>? progress = null);

Initializes a new instance of the ProgressReportingHttpContent class using a stream as content.

Parameter Type Default Description
content Stream Required The stream containing the content to be sent.
bufferSize int DefaultBufferSize The size of the buffer used for reading the content. Default is 8192 bytes.
contentType string "application/octet-stream" The MIME type of the content. Defaults to "application/octet-stream".
progress Action<long, long>? null Optional callback to report progress during transfer. Receives current bytes and total bytes.

View source: RestClient.Net/Utilities/ProgressReportingHttpContent.cs:65

.ctor

public ProgressReportingHttpContent(string data, int bufferSize = DefaultBufferSize, Action<long, long>? progress = null, string contentType = "application/octet-stream");

Initializes a new instance of the ProgressReportingHttpContent class using a string as content.

Parameter Type Default Description
data string Required The string data to be sent, which will be converted to bytes using UTF8 encoding.
bufferSize int DefaultBufferSize The size of the buffer used for reading the content. Default is 8192 bytes.
progress Action<long, long>? null Optional callback to report progress during transfer. Receives current bytes and total bytes.
contentType string "application/octet-stream" The MIME type of the content. Defaults to "application/octet-stream".

View source: RestClient.Net/Utilities/ProgressReportingHttpContent.cs:25