HttpResponseJsonExtensions.WriteAsJsonAsync メソッド

定義

オーバーロード

WriteAsJsonAsync(HttpResponse, Object, Type, CancellationToken)

指定した値を JSON として応答本文に書き込みます。 応答コンテンツ タイプは に application/json; charset=utf-8設定されます。

WriteAsJsonAsync(HttpResponse, Object, JsonTypeInfo, String, CancellationToken)

指定した値を JSON として応答本文に書き込みます。 応答コンテンツ タイプは、指定されたコンテンツ タイプに設定されます。

WriteAsJsonAsync(HttpResponse, Object, Type, JsonSerializerOptions, CancellationToken)

指定した値を JSON として応答本文に書き込みます。 応答コンテンツ タイプは に application/json; charset=utf-8設定されます。

WriteAsJsonAsync(HttpResponse, Object, Type, JsonSerializerOptions, String, CancellationToken)

指定した値を JSON として応答本文に書き込みます。 応答コンテンツ タイプは、指定されたコンテンツ タイプに設定されます。

WriteAsJsonAsync(HttpResponse, Object, Type, JsonSerializerContext, String, CancellationToken)

指定した値を JSON として応答本文に書き込みます。 応答コンテンツ タイプは、指定されたコンテンツ タイプに設定されます。

WriteAsJsonAsync<TValue>(HttpResponse, TValue, CancellationToken)

指定した値を JSON として応答本文に書き込みます。 応答コンテンツ タイプは に application/json; charset=utf-8設定されます。

WriteAsJsonAsync<TValue>(HttpResponse, TValue, JsonSerializerOptions, CancellationToken)

指定した値を JSON として応答本文に書き込みます。 応答コンテンツ タイプは に application/json; charset=utf-8設定されます。

WriteAsJsonAsync<TValue>(HttpResponse, TValue, JsonSerializerOptions, String, CancellationToken)

指定した値を JSON として応答本文に書き込みます。 応答コンテンツ タイプは、指定されたコンテンツ タイプに設定されます。

WriteAsJsonAsync<TValue>(HttpResponse, TValue, JsonTypeInfo<TValue>, String, CancellationToken)

指定した値を JSON として応答本文に書き込みます。 応答コンテンツ タイプは、指定されたコンテンツ タイプに設定されます。

WriteAsJsonAsync(HttpResponse, Object, Type, CancellationToken)

指定した値を JSON として応答本文に書き込みます。 応答コンテンツ タイプは に application/json; charset=utf-8設定されます。

public static System.Threading.Tasks.Task WriteAsJsonAsync (this Microsoft.AspNetCore.Http.HttpResponse response, object? value, Type type, System.Threading.CancellationToken cancellationToken = default);
static member WriteAsJsonAsync : Microsoft.AspNetCore.Http.HttpResponse * obj * Type * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function WriteAsJsonAsync (response As HttpResponse, value As Object, type As Type, Optional cancellationToken As CancellationToken = Nothing) As Task

パラメーター

response
HttpResponse

JSON を書き込む応答。

value
Object

JSON として書き込む値。

type
Type

書き込むオブジェクトの型。

cancellationToken
CancellationToken

CancellationToken操作を取り消すために使用される 。

戻り値

非同期操作を表すタスク オブジェクト。

適用対象

WriteAsJsonAsync(HttpResponse, Object, JsonTypeInfo, String, CancellationToken)

指定した値を JSON として応答本文に書き込みます。 応答コンテンツ タイプは、指定されたコンテンツ タイプに設定されます。

public static System.Threading.Tasks.Task WriteAsJsonAsync (this Microsoft.AspNetCore.Http.HttpResponse response, object? value, System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo, string? contentType = default, System.Threading.CancellationToken cancellationToken = default);
static member WriteAsJsonAsync : Microsoft.AspNetCore.Http.HttpResponse * obj * System.Text.Json.Serialization.Metadata.JsonTypeInfo * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function WriteAsJsonAsync (response As HttpResponse, value As Object, jsonTypeInfo As JsonTypeInfo, Optional contentType As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task

パラメーター

response
HttpResponse

JSON を書き込む応答。

value
Object

JSON として書き込む値。

jsonTypeInfo
JsonTypeInfo

変換する型に関するメタデータ。

contentType
String

応答で設定するコンテンツ タイプ。

cancellationToken
CancellationToken

CancellationToken操作を取り消すために使用される 。

戻り値

非同期操作を表すタスク オブジェクト。

適用対象

WriteAsJsonAsync(HttpResponse, Object, Type, JsonSerializerOptions, CancellationToken)

指定した値を JSON として応答本文に書き込みます。 応答コンテンツ タイプは に application/json; charset=utf-8設定されます。

public static System.Threading.Tasks.Task WriteAsJsonAsync (this Microsoft.AspNetCore.Http.HttpResponse response, object? value, Type type, System.Text.Json.JsonSerializerOptions? options, System.Threading.CancellationToken cancellationToken = default);
static member WriteAsJsonAsync : Microsoft.AspNetCore.Http.HttpResponse * obj * Type * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function WriteAsJsonAsync (response As HttpResponse, value As Object, type As Type, options As JsonSerializerOptions, Optional cancellationToken As CancellationToken = Nothing) As Task

パラメーター

response
HttpResponse

JSON を書き込む応答。

value
Object

JSON として書き込む値。

type
Type

書き込むオブジェクトの型。

options
JsonSerializerOptions

値をシリアル化するときに使用するシリアライザー オプション。

cancellationToken
CancellationToken

CancellationToken操作を取り消すために使用される 。

戻り値

非同期操作を表すタスク オブジェクト。

適用対象

WriteAsJsonAsync(HttpResponse, Object, Type, JsonSerializerOptions, String, CancellationToken)

指定した値を JSON として応答本文に書き込みます。 応答コンテンツ タイプは、指定されたコンテンツ タイプに設定されます。

public static System.Threading.Tasks.Task WriteAsJsonAsync (this Microsoft.AspNetCore.Http.HttpResponse response, object? value, Type type, System.Text.Json.JsonSerializerOptions? options, string? contentType, System.Threading.CancellationToken cancellationToken = default);
static member WriteAsJsonAsync : Microsoft.AspNetCore.Http.HttpResponse * obj * Type * System.Text.Json.JsonSerializerOptions * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function WriteAsJsonAsync (response As HttpResponse, value As Object, type As Type, options As JsonSerializerOptions, contentType As String, Optional cancellationToken As CancellationToken = Nothing) As Task

パラメーター

response
HttpResponse

JSON を書き込む応答。

value
Object

JSON として書き込む値。

type
Type

書き込むオブジェクトの型。

options
JsonSerializerOptions

値をシリアル化するときに使用するシリアライザー オプション。

contentType
String

応答で設定するコンテンツ タイプ。

cancellationToken
CancellationToken

CancellationToken操作を取り消すために使用される 。

戻り値

非同期操作を表すタスク オブジェクト。

適用対象

WriteAsJsonAsync(HttpResponse, Object, Type, JsonSerializerContext, String, CancellationToken)

指定した値を JSON として応答本文に書き込みます。 応答コンテンツ タイプは、指定されたコンテンツ タイプに設定されます。

public static System.Threading.Tasks.Task WriteAsJsonAsync (this Microsoft.AspNetCore.Http.HttpResponse response, object? value, Type type, System.Text.Json.Serialization.JsonSerializerContext context, string? contentType = default, System.Threading.CancellationToken cancellationToken = default);
static member WriteAsJsonAsync : Microsoft.AspNetCore.Http.HttpResponse * obj * Type * System.Text.Json.Serialization.JsonSerializerContext * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function WriteAsJsonAsync (response As HttpResponse, value As Object, type As Type, context As JsonSerializerContext, Optional contentType As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task

パラメーター

response
HttpResponse

JSON を書き込む応答。

value
Object

JSON として書き込む値。

type
Type

書き込むオブジェクトの型。

context
JsonSerializerContext

シリアル化可能な型のメタデータ プロバイダー。

contentType
String

応答で設定するコンテンツ タイプ。

cancellationToken
CancellationToken

CancellationToken操作を取り消すために使用される 。

戻り値

非同期操作を表すタスク オブジェクト。

適用対象

WriteAsJsonAsync<TValue>(HttpResponse, TValue, CancellationToken)

指定した値を JSON として応答本文に書き込みます。 応答コンテンツ タイプは に application/json; charset=utf-8設定されます。

public static System.Threading.Tasks.Task WriteAsJsonAsync<TValue> (this Microsoft.AspNetCore.Http.HttpResponse response, TValue value, System.Threading.CancellationToken cancellationToken = default);
static member WriteAsJsonAsync : Microsoft.AspNetCore.Http.HttpResponse * 'Value * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function WriteAsJsonAsync(Of TValue) (response As HttpResponse, value As TValue, Optional cancellationToken As CancellationToken = Nothing) As Task

型パラメーター

TValue

書き込むオブジェクトの型。

パラメーター

response
HttpResponse

JSON を書き込む応答。

value
TValue

JSON として書き込む値。

cancellationToken
CancellationToken

CancellationToken操作を取り消すために使用される 。

戻り値

非同期操作を表すタスク オブジェクト。

適用対象

WriteAsJsonAsync<TValue>(HttpResponse, TValue, JsonSerializerOptions, CancellationToken)

指定した値を JSON として応答本文に書き込みます。 応答コンテンツ タイプは に application/json; charset=utf-8設定されます。

public static System.Threading.Tasks.Task WriteAsJsonAsync<TValue> (this Microsoft.AspNetCore.Http.HttpResponse response, TValue value, System.Text.Json.JsonSerializerOptions? options, System.Threading.CancellationToken cancellationToken = default);
static member WriteAsJsonAsync : Microsoft.AspNetCore.Http.HttpResponse * 'Value * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function WriteAsJsonAsync(Of TValue) (response As HttpResponse, value As TValue, options As JsonSerializerOptions, Optional cancellationToken As CancellationToken = Nothing) As Task

型パラメーター

TValue

書き込むオブジェクトの型。

パラメーター

response
HttpResponse

JSON を書き込む応答。

value
TValue

JSON として書き込む値。

options
JsonSerializerOptions

値をシリアル化するときに使用するシリアライザー オプション。

cancellationToken
CancellationToken

CancellationToken操作を取り消すために使用される 。

戻り値

非同期操作を表すタスク オブジェクト。

適用対象

WriteAsJsonAsync<TValue>(HttpResponse, TValue, JsonSerializerOptions, String, CancellationToken)

指定した値を JSON として応答本文に書き込みます。 応答コンテンツ タイプは、指定されたコンテンツ タイプに設定されます。

public static System.Threading.Tasks.Task WriteAsJsonAsync<TValue> (this Microsoft.AspNetCore.Http.HttpResponse response, TValue value, System.Text.Json.JsonSerializerOptions? options, string? contentType, System.Threading.CancellationToken cancellationToken = default);
static member WriteAsJsonAsync : Microsoft.AspNetCore.Http.HttpResponse * 'Value * System.Text.Json.JsonSerializerOptions * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function WriteAsJsonAsync(Of TValue) (response As HttpResponse, value As TValue, options As JsonSerializerOptions, contentType As String, Optional cancellationToken As CancellationToken = Nothing) As Task

型パラメーター

TValue

書き込むオブジェクトの型。

パラメーター

response
HttpResponse

JSON を書き込む応答。

value
TValue

JSON として書き込む値。

options
JsonSerializerOptions

値をシリアル化するときに使用するシリアライザー オプション。

contentType
String

応答で設定するコンテンツ タイプ。

cancellationToken
CancellationToken

CancellationToken操作を取り消すために使用される 。

戻り値

非同期操作を表すタスク オブジェクト。

適用対象

WriteAsJsonAsync<TValue>(HttpResponse, TValue, JsonTypeInfo<TValue>, String, CancellationToken)

指定した値を JSON として応答本文に書き込みます。 応答コンテンツ タイプは、指定されたコンテンツ タイプに設定されます。

public static System.Threading.Tasks.Task WriteAsJsonAsync<TValue> (this Microsoft.AspNetCore.Http.HttpResponse response, TValue value, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue> jsonTypeInfo, string? contentType = default, System.Threading.CancellationToken cancellationToken = default);
static member WriteAsJsonAsync : Microsoft.AspNetCore.Http.HttpResponse * 'Value * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'Value> * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function WriteAsJsonAsync(Of TValue) (response As HttpResponse, value As TValue, jsonTypeInfo As JsonTypeInfo(Of TValue), Optional contentType As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task

型パラメーター

TValue

書き込むオブジェクトの型。

パラメーター

response
HttpResponse

JSON を書き込む応答。

value
TValue

JSON として書き込む値。

jsonTypeInfo
JsonTypeInfo<TValue>

変換する型に関するメタデータ。

contentType
String

応答で設定するコンテンツ タイプ。

cancellationToken
CancellationToken

CancellationToken操作を取り消すために使用される 。

戻り値

非同期操作を表すタスク オブジェクト。

適用対象