I am trying to send a hyper response with a specific number of bytes and chunks. I've been lost on how to generate a generic chunked response or set the transfer-encoding header. There seemed to be a httpWriter/chunkedWriter for hyper which is now depreciated.
This is my attempt, but the transfer-encoding header is not being set and I don't believe that this is the right way to have a chunked response.
let chunked_body = "5\r\nhello\r\n5\r\n worl\r\n1\r\nd\r\n0\r\n\r\n";
let mut resp: hyper::Response<Body> = Response::new(Body::from(chunked_body));
resp.headers_mut().insert(TRANSFER_ENCODING, HeaderValue::from_static("Chunked"));
Ok(resp)