Expand description
§mini_http
§Basic Example
mini_http::Server::new("127.0.0.1:3002")?
.start(|request| {
mini_http::Response::builder()
.status(200)
.body(b"Hello!\n".to_vec())
.unwrap()
})?;
Note: If you’re experiencing poor performance on benchmarks, see
tcp_nodelay
Modules§
- header
- HTTP header types
- method
- The HTTP request method
- response
- HTTP response types.
- status
- HTTP status codes
- uri
- URI component of request and response lines
- version
- HTTP version
Structs§
- Error
- The Error type.
- Request
Request
received and used by handlers. Wraps &deref
s to anhttp::Request
and patchesRequest::body
to return the correct slice of bytes from theHttpStreamReader.read_buf
- Response
- Re-exported
http::Response
for constructing return responses in handlers Represents an HTTP response - Server
Enums§
- Error
Kind - The kind of an error.
Traits§
- Result
Ext - Additional methods for
Result
, for easy interaction with this crate.
Type Aliases§
- Result
- Convenient wrapper around
std::Result
.