Lue englanniksi

Jaa


HttpResponseJsonExtensions Class

Definition

Provides extension methods for writing a JSON serialized value to the HTTP response.

C#
public static class HttpResponseJsonExtensions
Inheritance
HttpResponseJsonExtensions

Methods

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

Write the specified value as JSON to the response body. The response content-type will be set to the specified content-type.

WriteAsJsonAsync(HttpResponse, Object, Type, CancellationToken)

Write the specified value as JSON to the response body. The response content-type will be set to application/json; charset=utf-8.

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

Write the specified value as JSON to the response body. The response content-type will be set to the specified content-type.

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

Write the specified value as JSON to the response body. The response content-type will be set to application/json; charset=utf-8.

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

Write the specified value as JSON to the response body. The response content-type will be set to the specified content-type.

WriteAsJsonAsync<TValue>(HttpResponse, TValue, CancellationToken)

Write the specified value as JSON to the response body. The response content-type will be set to application/json; charset=utf-8.

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

Write the specified value as JSON to the response body. The response content-type will be set to application/json; charset=utf-8.

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

Write the specified value as JSON to the response body. The response content-type will be set to the specified content-type.

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

Write the specified value as JSON to the response body. The response content-type will be set to the specified content-type.

Applies to

Tuote Versiot
ASP.NET Core 5.0, 6.0, 7.0, 8.0, 9.0