I am trying to perform a HTTP GET request with reqwest and print the response body to STDOUT. This works for most websites, but it returns weird binary output for amazon.com:
#[tokio::main]
async fn main() {
run().await;
}
async fn run() {
let url = "https://www.amazon.com/PNY-GeForce-Gaming-Overclocked-Graphics/dp/B07GJ7TV8L/";
let resp = reqwest::get(url).await.unwrap();
let text = resp.text().await.unwrap();
println!("{}", text);
}
Why would resp.text().await.unwrap() return binary data and how can I obtain normal HTTP body from it?
curl returns the HTML I expected:
curl https://www.amazon.com/PNY-GeForce-Gaming-Overclocked-Graphics/dp/B07GJ7TV8L/