handy_http_data.json

Defines functions to read and write JSON values when handling HTTP requests.

Members

Functions

readJsonBodyAs
T readJsonBodyAs(ServerHttpRequest request)

Reads a JSON value from the body of the given HTTP request, parsing it using the ASDF library according to the template type T.

writeJsonBody
void writeJsonBody(ServerHttpResponse response, T bodyContent)

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.