Skip to main content

Module http

Module http 

Source
Expand description

HTTP primitives: Request, Response, response builders, and a small FormData parser shared by query strings and form bodies.

Request wraps hyper::Request and adds a typed per-request Context. It derefs to the underlying hyper request so the usual accessors (.method(), .uri(), .headers(), .body_mut()) are available directly.

Structs§

FormData
Parsed application/x-www-form-urlencoded data.
Request
Incoming HTTP request with an attached per-request Context and, when known, the peer address the TCP connection came from.

Constants§

MAX_REQUEST_BODY_BYTES
Maximum bytes accepted from a request body across the framework.

Functions§

html
Build a 200 OK response with text/html content type.
json_raw
Build a 200 OK response with application/json content type.
set_cookie
Append a Set-Cookie header to a response.
status_text
Build a response with an arbitrary status code and a text/plain body.
text
Build a 200 OK response with text/plain content type.

Type Aliases§

Response