Skip to main content

getJsonResponse

getJsonResponse<TBody>(body, status, headers?): Response

Creates a JSON response with the specified body, status, and headers.

Type Parameters

TBody

TBody

Parameters

body

ApiResponse<TBody>

The response body to be sent to the client as JSON.

status

number

The HTTP status code for the response.

headers?

HeadersInit

Optional headers to include in the response.

Returns

Response