KestrunResponse.WriteResponseAsync method

Asynchronously writes a response with the specified input object and HTTP status code. Chooses the response format based on the Accept header or defaults to text/plain.

public Task WriteResponseAsync(object? inputObject, int statusCode = 200)
parameter description
inputObject The object to be sent in the response body.
statusCode The HTTP status code for the response.

See Also