adding method to extract separately string, instead of parse

This commit is contained in:
midefos 2025-01-23 17:15:50 +01:00
parent cc2661d8ac
commit 4448684400

View File

@ -19,6 +19,6 @@ impl Requester {
req: Request<Incoming>,
) -> Result<String, Box<dyn Error + Send + Sync>> {
let body = req.collect().await?.to_bytes();
Ok(String::from_utf8_lossy(&body).to_string())
Ok(String::from_utf8(body.to_vec())?)
}
}