Expand description
Some ways to define this crate:
- Adaptor between
httparse
andhttp
crates. - Super-lowlevel web framework, almost minimal one around
http
crate. - A way to make bytes to/from HTTP request/responses
HTTP 1 only, no HTTP 2.
Body is not touched in any way. Not performance-optimized. Request handling code tries to to Basic Authorization (can opt out).
Supports Rust 1.28.0
Re-exports§
pub extern crate http;
Enums§
- Error
- Error handling for this crate
Constants§
- EMPTY_
HEADER - An empty header, useful for constructing a
Header
array to pass in for parsing.
Functions§
- parse_
request_ header - Parse this byte buffer into a
Request
plus remaining trailing bytes. - parse_
request_ header_ easy - Parse this byte buffer into a
Request
plus remaining trailing bytes. ReturnsOk(None)
if not enough bytes yet to produce a complete request. Allocates a space for 50 headers (about 800 bytes) in stack each time. - parse_
response_ header - Parse this byte buffer into a
Response
plus remaining trailing bytes. - parse_
response_ header_ easy - Parse this byte buffer into a
Response
plus remaining trailing bytes. ReturnsOk(None)
if not enough bytes yet to produce a complete response. Allocates a space for 50 headers (about 800 bytes) in stack each time. - request_
header_ to_ vec - Easy version of
write_request_header
. See its doc for details Panics on problems - response_
header_ to_ vec - Easy version of
write_response_header
. See its doc for details Panics on problems - write_
request_ header - Write request line and headers (but not body) of this HTTP 1.1 request May add ‘Host:’ header automatically Returns number of bytes written
- write_
response_ header - Write response line and headers (but not body) of this HTTP 1.1 response