lil-http
A barebones HTTP 1.1 framework, built in Rust with no external dependencies (other than tokio).
Features
- Listening to incoming requests
- Parsing method, path, query, headers, and body according to the HTTP 1.1 spec
- Responding to requests with an arbitrary body and headers
- Helpers for responding with text or JSON
- Allow defining routes and methods as closures
- Appropiately routing the request to its function, or 404'ing otherwise
- Appropiately crafting and returning 405 errors on invalid methods.
Usage
use ;
async
License
This project is licensed under the MIT License - see the LICENSE file for details.