Skip to main content

Module response

Module response 

Source
Available on crate feature http only.
Expand description

Turning documents and errors into HTTP responses.

A handler returns Created, Ok or a JsonApiError and gets the right status, the JSON:API media type, and a correctly shaped body. None of that is assembled at a call site.

Structs§

Created
201 Created with the resource and its Location header.
Download
Raw bytes, with their own media type — a file, not a document.
Errors
Several errors in one response.
Fetched
200 OK with a document.
NoContent
204 No Content — a successful delete.
Streamedstreaming
A JSONL body, written one line at a time.

Functions§

disposition
Build a Content-Disposition value, safely.