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. ...
...Both are built on top of this library. A Service lets you define how to respond to incoming requests. While it is possible to implement the trait directly, there are a few patterns that are common when using Hyper. We’ve included some helpers for when these patterns fit our needs. An echo server will listen for incoming connections and send back the request body as the response body on POST requests.