writeJsonBody

Writes a JSON value to the body of the given HTTP response, serializing it using the ASDF library. Will also set Content-Type and Content-Length headers before writing.

Throws an INTERNAL_SERVER_ERROR HttpStatusException if serialization or writing fails.

void
writeJsonBody
(
T
)
(
ref ServerHttpResponse response
,)

Parameters

response ServerHttpResponse

The response to write to.

bodyContent T

The content to write.