Unable convert hyper::Body to string hyper 0.11.24


#1

In a project we have the plan to use a web server for parsing JSON, our chosen web server APIs is hyper 0.11.24, but we have a problem with getting request body and converting it to string, our problem is about converting hyper::Body to string for parsing is JSON parser function.
I read the documentation, and I couldn’t find any solution for doing that.
https://docs.rs/hyper/0.11.24/hyper/struct.Body.html
This is peace of my code:

            (&hyper::Method::Post, "/api") => {
                let mut response = hyper::Response::new();
                response.set_body(req.body());
                response
            }

I will be grateful if someone could help me solve my problem


#2

Take a look at https://mgattozzi.com/hyper-async as an example.