Is there any way to overwrite sensitive data after sending a post request using the Reqwest library?
Basically like this example I would want to clear out the password after the request. However as far as I can find the data gets copied into the body no matter what so the zeroing of the other data doesn't work because there's still a copy I don't have control over.
pub fn login(username: &str, password: &Zeroizing<String>) -> Result {
let client = reqwest::blocking::Client::new();
let json = Zeroizing::new(format!("{{\"username\": \"{}\", \"password\": \"{}\"}}", username, password.as_str()).to_string());
let json_v = Zeroizing::new(Vec::from(json.as_str()));
let res2 = client.post("https://myurl.com").body(json_v.to_vec()).header("content-type", "application/json").send();
}