use serde_json::{self, Value}; use hyper::http::HeaderValue; use hyper::Response; use hyper::Body; use hyper::body::to_bytes; use std::u8; const APP_JSON_HEADER: &'static str = "application/json"; const CONTENT_TYPE: &'static str = "Content-Type"; pub fn set_json_body(response: &mut Response
, values: Value) { response.headers_mut().insert( CONTENT_TYPE, HeaderValue::from_static(APP_JSON_HEADER)); *response.body_mut() = Body::from(values.to_string()); } pub async fn parse_json_params(body_raw: &mut Body) -> Result