KestrunResponse.WriteResponse method

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 void WriteResponse(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