HttpResponseWritingExtensions.WriteAsync Method
Definition
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.
Overloads
WriteAsync(HttpResponse, String, CancellationToken) |
Writes the given text to the response body. UTF-8 encoding will be used. |
WriteAsync(HttpResponse, String, Encoding, CancellationToken) |
Writes the given text to the response body using the given encoding. |
WriteAsync(HttpResponse, String, CancellationToken)
Writes the given text to the response body. UTF-8 encoding will be used.
public static System.Threading.Tasks.Task WriteAsync (this Microsoft.AspNetCore.Http.HttpResponse response, string text, System.Threading.CancellationToken cancellationToken = default);
static member WriteAsync : Microsoft.AspNetCore.Http.HttpResponse * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function WriteAsync (response As HttpResponse, text As String, Optional cancellationToken As CancellationToken = Nothing) As Task
Parameters
- response
- HttpResponse
The HttpResponse.
- text
- String
The text to write to the response.
- cancellationToken
- CancellationToken
Notifies when request operations should be cancelled.
Returns
A task that represents the completion of the write operation.
Applies to
WriteAsync(HttpResponse, String, Encoding, CancellationToken)
Writes the given text to the response body using the given encoding.
public static System.Threading.Tasks.Task WriteAsync (this Microsoft.AspNetCore.Http.HttpResponse response, string text, System.Text.Encoding encoding, System.Threading.CancellationToken cancellationToken = default);
static member WriteAsync : Microsoft.AspNetCore.Http.HttpResponse * string * System.Text.Encoding * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function WriteAsync (response As HttpResponse, text As String, encoding As Encoding, Optional cancellationToken As CancellationToken = Nothing) As Task
Parameters
- response
- HttpResponse
The HttpResponse.
- text
- String
The text to write to the response.
- encoding
- Encoding
The encoding to use.
- cancellationToken
- CancellationToken
Notifies when request operations should be cancelled.
Returns
A task that represents the completion of the write operation.