HttpResponseWritingExtensions.WriteAsync 方法

定义

重载

WriteAsync(HttpResponse, String, CancellationToken)

将给定文本写入响应正文。 将使用 UTF-8 编码。

WriteAsync(HttpResponse, String, Encoding, CancellationToken)

使用给定编码将给定文本写入响应正文。

WriteAsync(HttpResponse, String, CancellationToken)

Source:
HttpResponseWritingExtensions.cs
Source:
HttpResponseWritingExtensions.cs
Source:
HttpResponseWritingExtensions.cs

将给定文本写入响应正文。 将使用 UTF-8 编码。

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

参数

text
String

要写入响应的文本。

cancellationToken
CancellationToken

通知何时应取消请求操作。

返回

表示写入操作完成的任务。

适用于

WriteAsync(HttpResponse, String, Encoding, CancellationToken)

Source:
HttpResponseWritingExtensions.cs
Source:
HttpResponseWritingExtensions.cs
Source:
HttpResponseWritingExtensions.cs

使用给定编码将给定文本写入响应正文。

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

参数

text
String

要写入响应的文本。

encoding
Encoding

要使用的编码。

cancellationToken
CancellationToken

通知何时应取消请求操作。

返回

表示写入操作完成的任务。

适用于