HttpContent.LoadIntoBufferAsync Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Serialize the HTTP content to a memory buffer as an asynchronous operation.
LoadIntoBufferAsync(Int64, CancellationToken) |
Serialize the HTTP content to a memory buffer as an asynchronous operation. |
LoadIntoBufferAsync(CancellationToken) |
Serialize the HTTP content to a memory buffer as an asynchronous operation. |
LoadIntoBufferAsync(Int64) |
Serialize the HTTP content to a memory buffer as an asynchronous operation. |
LoadIntoBufferAsync() |
Serialize the HTTP content to a memory buffer as an asynchronous operation. |
This operation will not block.
Serialize the HTTP content to a memory buffer as an asynchronous operation.
public:
System::Threading::Tasks::Task ^ LoadIntoBufferAsync(long maxBufferSize, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task LoadIntoBufferAsync(long maxBufferSize, System.Threading.CancellationToken cancellationToken);
member this.LoadIntoBufferAsync : int64 * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function LoadIntoBufferAsync (maxBufferSize As Long, cancellationToken As CancellationToken) As Task
Parameters
- maxBufferSize
- Int64
The maximum size, in bytes, of the buffer to use.
- cancellationToken
- CancellationToken
The cancellation token to cancel the operation.
Returns
The task object representing the asynchronous operation.
Exceptions
The cancellation token was canceled. This exception is stored into the returned task.
The object has already been disposed.
Remarks
This operation will not block. The returned Task object will complete after all of the content has been serialized to the memory buffer.
After content is serialized to a memory buffer, calls to one of the CopyToAsync(Stream) methods will copy the content of the memory buffer to the target stream.
Applies to
.NET 10 and .NET 9
Product | Versions |
---|---|
.NET | 9, 10 |
Serialize the HTTP content to a memory buffer as an asynchronous operation.
public:
System::Threading::Tasks::Task ^ LoadIntoBufferAsync(System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task LoadIntoBufferAsync(System.Threading.CancellationToken cancellationToken);
member this.LoadIntoBufferAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function LoadIntoBufferAsync (cancellationToken As CancellationToken) As Task
Parameters
- cancellationToken
- CancellationToken
The cancellation token to cancel the operation.
Returns
The task object representing the asynchronous operation.
Exceptions
The cancellation token was canceled. This exception is stored into the returned task.
The object has already been disposed.
Remarks
This operation will not block. The returned Task object will complete after all of the content has been serialized to the memory buffer.
After content is serialized to a memory buffer, calls to one of the CopyToAsync(Stream) methods will copy the content of the memory buffer to the target stream.
Applies to
.NET 10 and .NET 9
Product | Versions |
---|---|
.NET | 9, 10 |
- Source:
- HttpContent.cs
- Source:
- HttpContent.cs
- Source:
- HttpContent.cs
Serialize the HTTP content to a memory buffer as an asynchronous operation.
public:
System::Threading::Tasks::Task ^ LoadIntoBufferAsync(long maxBufferSize);
public System.Threading.Tasks.Task LoadIntoBufferAsync(long maxBufferSize);
member this.LoadIntoBufferAsync : int64 -> System.Threading.Tasks.Task
Public Function LoadIntoBufferAsync (maxBufferSize As Long) As Task
Parameters
- maxBufferSize
- Int64
The maximum size, in bytes, of the buffer to use.
Returns
The task object representing the asynchronous operation.
Remarks
This operation will not block. The returned Task object will complete after all of the content has been serialized to the memory buffer.
After content is serialized to a memory buffer, calls to one of the CopyToAsync methods will copy the content of the memory buffer to the target stream.
If the content exceeds the value passed in the maxBufferSize
parameter, an exception is thrown.
Applies to
.NET 10 and other versions
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- Source:
- HttpContent.cs
- Source:
- HttpContent.cs
- Source:
- HttpContent.cs
Serialize the HTTP content to a memory buffer as an asynchronous operation.
public:
System::Threading::Tasks::Task ^ LoadIntoBufferAsync();
public System.Threading.Tasks.Task LoadIntoBufferAsync();
member this.LoadIntoBufferAsync : unit -> System.Threading.Tasks.Task
Public Function LoadIntoBufferAsync () As Task
Returns
The task object representing the asynchronous operation.
Remarks
This operation will not block. The returned Task object will complete after all of the content has been serialized to the memory buffer.
After content is serialized to a memory buffer, calls to one of the CopyToAsync methods will copy the content of the memory buffer to the target stream.
Applies to
.NET 10 and other versions
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: