System::Net::Http::HttpContent class

HttpContent class

Represents content of an HTTP entity. Object of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.

class HttpContent : public System::IDisposable

Methods

MethodDescription
Dispose() overrideDisposes the current instance. This method also disposes the stream that is returned by ‘ReadAsStream’ and the memory buffer if it is created.
get_Headers()Returns the HTTP content headers.
LoadIntoBuffer()Serializes content to a memory buffer.
LoadIntoBuffer(int64_t)Serializes content to a memory buffer.
ReadAsByteArray()Serializes content and returns a byte array.
ReadAsStream()Serializes content and returns a stream.
ReadAsString()Serializes content and returns a string.
virtual TryComputeLength(int64_t&)Tries to calculate the content size.

Fields

FieldDescription
static DefaultStringEncodingThe default encoding.
static MaxBufferSizeThe maximum number of bytes.

See Also