Udostępnij za pośrednictwem


HttpProgress Struct

Definition

Contains status information on the progress of an HttpClient operation.

/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
struct HttpProgress
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public struct HttpProgress
var httpProgress = {
stage : /* Your value */,
bytesSent : /* Your value */,
totalBytesToSend : /* Your value */,
bytesReceived : /* Your value */,
totalBytesToReceive : /* Your value */,
retries : /* Your value */
}
Public Structure HttpProgress
Inheritance
HttpProgress
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Remarks

When sending (POST method) an HttpBufferContent class, the value jumps from 0% bytes sent to 100% bytes sent in one progress event, because the whole buffer is moved to lower network APIs all at once. For more detailed progress, use HttpStreamContent instead of HttpBufferContent, because streams are read and sent in smaller chunks, resulting in more progress events. E.g. 0 bytes sent, 65536 bytes sent, 131072 bytes sent, etc.

Fields

BytesReceived

The total number of bytes received.

This value includes bytes received as response headers.

If the operation was restarted, this value may be smaller than in the previous progress report.

BytesSent

The total number of bytes sent.

This value includes bytes sent as request headers.

If the operation was restarted, this value may be smaller than in the previous progress report.

Retries

The number of retries.

Stage

The step in the progress of an HTTP connection.

TotalBytesToReceive

The total number of data bytes to receive.

If the number is unknown, this value is 0.

TotalBytesToSend

The total number of data bytes to send.

If the number is unknown, this value is 0.

Applies to

See also