use serde_json::{self, Value}; use hyper::body::{to_bytes, Bytes}; use hyper::Body; use std::u8; pub async fn parse_params(body_raw: &mut Body) -> Result { let bytes: &[u8] = &*to_bytes(body_raw).await.unwrap(); // rarely fails let values: Value = serde_json::from_slice(bytes)?; Ok(values) }