HttpBufferContent Klasse

Definition

Stellt HTTP-Inhalt bereit, der einen Puffer verwendet.

public ref class HttpBufferContent sealed : IClosable, IStringable, IHttpContent
/// [Windows.Foundation.Metadata.Activatable(Windows.Web.Http.IHttpBufferContentFactory, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class HttpBufferContent final : IClosable, IStringable, IHttpContent
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(Windows.Web.Http.IHttpBufferContentFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class HttpBufferContent final : IClosable, IStringable, IHttpContent
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Web.Http.IHttpBufferContentFactory), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class HttpBufferContent : System.IDisposable, IStringable, IHttpContent
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Web.Http.IHttpBufferContentFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class HttpBufferContent : System.IDisposable, IStringable, IHttpContent
function HttpBufferContent(content, offset, count)
Public NotInheritable Class HttpBufferContent
Implements IDisposable, IHttpContent, IStringable
Vererbung
Object Platform::Object IInspectable HttpBufferContent
Attribute
Implementiert

Windows-Anforderungen

Gerätefamilie
Windows 10 (eingeführt in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (eingeführt in v1.0)

Hinweise

Beim Senden (POST-Methode) einer HttpBufferContent-Klasse springt der HttpProgress.BytesSent-Wert von 0 % gesendeter Bytes zu 100 % Bytes, die in einem Fortschrittsereignis gesendet werden, da der gesamte Puffer auf einmal in niedrigere Netzwerk-APIs verschoben wird. Verwenden Sie für ausführlichere Fortschritte HttpStreamContent anstelle von HttpBufferContent, da Datenströme in kleineren Blöcken gelesen und gesendet werden, was zu mehr Fortschrittsereignissen führt. Z. B. 0 gesendete Bytes, 65536 Bytes gesendet, 131072 gesendete Bytes usw.

Konstruktoren

HttpBufferContent(IBuffer)

Initialisiert eine neue instance der HttpBufferContent-Klasse mit dem angegebenen Puffer.

HttpBufferContent(IBuffer, UInt32, UInt32)

Initialisiert eine neue instance der HttpBufferContent-Klasse mit einem Offset und der Anzahl der Bytes aus dem angegebenen Puffer.

Eigenschaften

Headers

Rufen Sie eine Sammlung von Inhaltsheadern ab, die für httpBufferContent festgelegt sind.

Methoden

BufferAllAsync()

Serialisieren Sie httpBufferContent als asynchroner Vorgang in den Arbeitsspeicher.

Close()

Schließt die zugeordneten Ressourcen httpBufferContent instance und veröffentlicht.

Dispose()

Führt anwendungsspezifische Aufgaben durch, die mit der Freigabe, der Zurückgabe oder dem Zurücksetzen von nicht verwalteten Ressourcen zusammenhängen.

ReadAsBufferAsync()

Serialisieren Sie httpBufferContent als asynchronen Vorgang in einen Puffer.

ReadAsInputStreamAsync()

Serialisieren Sie httpBufferContent , und geben Sie einen Eingabedatenstrom zurück, der den Inhalt als asynchronen Vorgang darstellt.

ReadAsStringAsync()

Serialisieren Sie httpBufferContent als asynchronen Vorgang in eine Zeichenfolge .

ToString()

Gibt eine Zeichenfolge zurück, die das aktuelle HttpBufferContent-Objekt darstellt.

TryComputeLength(UInt64)

Berechnet die HttpBufferContent-Länge in Bytes.

WriteToStreamAsync(IOutputStream)

Schreiben Sie httpBufferContent als asynchronen Vorgang in einen Ausgabedatenstrom.

Gilt für:

Weitere Informationen