Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Net.​Http.​ReadOnlyMemoryContent

Assembly: System.Net.Http

Inheritance: object → HttpContent → ReadOnlyMemoryContent

Implemented Interfaces

Provides HTTP content based on a <see cref="T:System.ReadOnlyMemory`1" /> .

Properties

Headers
Gets the HTTP content headers as defined in RFC 2616.

Methods

protected IO.​Stream
CreateContentReadStream​(Threading.​CancellationToken cancellationToken)
CreateContentReadStreamAsync​()
protected void
SerializeToStream​(IO.​Stream stream, TransportContext? context, Threading.​CancellationToken cancellationToken)
SerializeToStreamAsync​(IO.​Stream stream, TransportContext? context)
SerializeToStreamAsync​(IO.​Stream stream, TransportContext? context, Threading.​CancellationToken cancellationToken)
public void
CopyTo​(IO.​Stream stream, TransportContext? context, Threading.​CancellationToken cancellationToken)
Inherited from HttpContent
Serializes the HTTP content into a stream of bytes and copies it to <paramref name="stream" /> .
stream The target stream.
context Information about the transport (for example, the channel binding token). This parameter may be <see langword="null" /> .
cancellationToken The cancellation token to cancel the operation.
CopyToAsync​(IO.​Stream stream)
Inherited from HttpContent
Serialize the HTTP content into a stream of bytes and copies it to the stream object provided as the <paramref name="stream" /> parameter.
Returns The task object representing the asynchronous operation.
stream The target stream.
CopyToAsync​(IO.​Stream stream, TransportContext? context)
Inherited from HttpContent
Serialize the HTTP content into a stream of bytes and copies it to the stream object provided as the <paramref name="stream" /> parameter.
Returns The task object representing the asynchronous operation.
stream The target stream.
context Information about the transport (channel binding token, for example). This parameter may be <see langword="null" /> .
CopyToAsync​(IO.​Stream stream, TransportContext? context, Threading.​CancellationToken cancellationToken)
Inherited from HttpContent
Serialize the HTTP content into a stream of bytes and copies it to the stream object provided as the <paramref name="stream" /> parameter.
Returns The task object representing the asynchronous operation.
stream The target stream.
context Information about the transport (channel binding token, for example). This parameter may be <see langword="null" /> .
cancellationToken The cancellation token to cancel the operation.
CopyToAsync​(IO.​Stream stream, Threading.​CancellationToken cancellationToken)
Inherited from HttpContent
Serialize the HTTP content into a stream of bytes and copies it to the stream object provided as the <paramref name="stream" /> parameter.
Returns The task object representing the asynchronous operation.
stream The target stream.
cancellationToken The cancellation token to cancel the operation.
CreateContentReadStreamAsync​(Threading.​CancellationToken cancellationToken)
Inherited from HttpContent
Serializes the HTTP content to a memory stream as an asynchronous operation.
Returns The task object representing the asynchronous operation.
cancellationToken The cancellation token to cancel the operation.
public void
Dispose​()
Inherited from HttpContent
Releases the unmanaged resources and disposes of the managed resources used by the <see cref="T:System.Net.Http.HttpContent" /> .
protected void
Dispose​(bool disposing)
Inherited from HttpContent
Releases the unmanaged resources used by the <see cref="T:System.Net.Http.HttpContent" /> and optionally disposes of the managed resources.
disposing <see langword="true" /> to release both managed and unmanaged resources; <see langword="false" /> to releases only unmanaged resources.
LoadIntoBufferAsync​()
Inherited from HttpContent
Serialize the HTTP content to a memory buffer as an asynchronous operation.
Returns The task object representing the asynchronous operation.
LoadIntoBufferAsync​(Threading.​CancellationToken cancellationToken)
Inherited from HttpContent
Serialize the HTTP content to a memory buffer as an asynchronous operation.
Returns The task object representing the asynchronous operation.
cancellationToken The cancellation token to cancel the operation.
LoadIntoBufferAsync​(long maxBufferSize)
Inherited from HttpContent
Serialize the HTTP content to a memory buffer as an asynchronous operation.
Returns The task object representing the asynchronous operation.
maxBufferSize The maximum size, in bytes, of the buffer to use.
LoadIntoBufferAsync​(long maxBufferSize, Threading.​CancellationToken cancellationToken)
Inherited from HttpContent
Serialize the HTTP content to a memory buffer as an asynchronous operation.
Returns The task object representing the asynchronous operation.
maxBufferSize The maximum size, in bytes, of the buffer to use.
cancellationToken The cancellation token to cancel the operation.
public Threading.​Tasks.​Task<​byte[]>
ReadAsByteArrayAsync​()
Inherited from HttpContent
Serialize the HTTP content to a byte array as an asynchronous operation.
Returns The task object representing the asynchronous operation.
public Threading.​Tasks.​Task<​byte[]>
ReadAsByteArrayAsync​(Threading.​CancellationToken cancellationToken)
Inherited from HttpContent
Serialize the HTTP content to a byte array as an asynchronous operation.
Returns The task object representing the asynchronous operation.
cancellationToken The cancellation token to cancel the operation.
public IO.​Stream
ReadAsStream​()
Inherited from HttpContent
Serializes the HTTP content and returns a stream that represents the content.
Returns The stream that represents the HTTP content.
public IO.​Stream
ReadAsStream​(Threading.​CancellationToken cancellationToken)
Inherited from HttpContent
Serializes the HTTP content and returns a stream that represents the content.
Returns The stream that represents the HTTP content.
cancellationToken The cancellation token to cancel the operation.
ReadAsStreamAsync​()
Inherited from HttpContent
Serialize the HTTP content and return a stream that represents the content as an asynchronous operation.
Returns The task object representing the asynchronous operation.
ReadAsStreamAsync​(Threading.​CancellationToken cancellationToken)
Inherited from HttpContent
Serialize the HTTP content and return a stream that represents the content as an asynchronous operation.
Returns The task object representing the asynchronous operation.
cancellationToken The cancellation token to cancel the operation.
public Threading.​Tasks.​Task<​string>
ReadAsStringAsync​()
Inherited from HttpContent
Serialize the HTTP content to a string as an asynchronous operation.
Returns The task object representing the asynchronous operation.
public Threading.​Tasks.​Task<​string>
ReadAsStringAsync​(Threading.​CancellationToken cancellationToken)
Inherited from HttpContent
Serialize the HTTP content to a string as an asynchronous operation.
Returns The task object representing the asynchronous operation.
cancellationToken The cancellation token to cancel the operation.
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object