Expose http_service::Request
- Dominant language
- Rust
- Stars
- 5.1k
- Forks
- 329
- PR merge metrics
- No merged PRs in 30d
Description
To make a library server-agnostic, it would make sense to use `http::Request` (or `http_service::Request`) over `tide::Request` where possible. [multipart_async](https://github.com/abonander/multipart-async/blob/master/src/server/mod.rs#L148) does this by providing `Multipart::try_from_request` that takes a `http_service::Request`.
There is currently no way to get the underlying `http_service::Request` from a `tide::Request`.
Some ways this could be accomplished:
1. Separate `tide::Request` into two structures that get passed to endpoints: `http_service::Request` and `Context`. `Context` would contain the route parameters and state. Move the `body_*()` methods from `tide::Request` into `http_service::Request` or into a `RequestExt` trait.
2. Implement `Into` for `tide::Request`. This is how `tide::Response` works.
3. ???
Contributor guide
Assessment
This issue has not been assessed yet.