Expand description
HTTP responses: Response, its writers and the upstream-response parser.
A response has a status, headers and a body as a list of
ContentRanges (one, or several for a
multipart/byteranges range response), or a stream_file / stream_pipe
for bodies too large to buffer. Response::json / Response::text build the
common cases. The writers (generate_response, generate_response_parts,
…) add Content-Type, Content-Length and Content-Range;
Response::parse reads a raw upstream response (used by the proxy).
Examples: src/response/example/.
Structs§
- Error
- Response
- An HTTP response. Build one inside [
Controller::process] and return it. - Response
Status Code Reason Phrase - Status
Code Reason Phrase
Constants§
Functions§
- content_
range_ header_ value - The
Content-Rangevalue for a single-part body, orNonewhen the response shouldn’t carry one. RFC 9110 §14.4 givesContent-Rangemeaning only on206 Partial Content(and416, which rws answers with a plain error body), so full200responses get no such header.range.endis inclusive.