Response

Use the global response object to set outgoing response data. The response object API is defined below.

napkin.response

body

type: str or dict

A string or JSON object to return as a response payload.

headers

type: dict

A dictionary of headers to return in the response.

status_code

type: int

HTTP status code to return in the response.