Expand description
HttpContext — runtime implementation of IHttpContext, IHttpRequest, IHttpResponse.
§Request body
The body is not read eagerly. It stays as the live hyper stream until something asks for it:
IHttpRequest::body_bytesbuffers the whole body, enforcingApp.MaxBodySize.IHttpRequest::multipartstreams the body through a multipart parser, enforcingForm.MaxRequestSize,Form.MaxFileSizeandForm.MaxFieldSize, and spooling large file parts to disk.
Either way the body can only be consumed once; asking for it twice reports a clear error rather than silently returning an empty body.
§Response body
Responses carry either in-memory bytes or a FileBody. File bodies are
streamed by the host with Content-Length, ETag, Last-Modified,
Accept-Ranges and Content-Disposition, and satisfy Range,
If-Range, If-None-Match and If-Modified-Since requests, so downloads
can be cached and resumed.
Structs§
- Body
Limits - Limits applied while reading a request body.
- Http
Context - Concrete implementation of IHttpContext wrapping a hyper request and response.
- Http
Request - Concrete implementation of IHttpRequest.
- Http
Response - Concrete implementation of IHttpResponse.
Type Aliases§
- Resp
Body - Response body produced by the HTTP host.