This crate is a general purpose library for common types found when working with the HTTP protocol. You’ll find Request and Response types for working as either a client or a server as well as all of their components. Notably you’ll find Uri for what a Request is requesting, a Method for how it’s being requested, a StatusCode for what sort of response came back, a Version for how this was communicated, and HeaderName/HeaderValue definitions to get grouped in a HeaderMap to work with request/response headers. You will notably not find an implementation of sending requests or spinning up a server in this crate. It’s intended that this crate is the “standard library” for HTTP clients and servers without dictating any particular implementation. Note that this crate is still early on in its lifecycle so the support libraries that integrate with the http crate are a work in progress! Stay tuned and we’ll be sure to highlight crates here in the future.
Features
- HTTP header interpretation and generation
- Parse header names from strings
- Header values can be created from string literals through the from_static function
- Header values can also be parsed like names
- Each HTTP Request has an associated URI with it
- A general purpose library of common HTTP types