Hi , I searched everywhere and found some answers as well but they are old and I can't figure out how can I do this. Can anybody help? (sorry for my english)
I think something like this should work ?
fn main() {
let mut file = std::fs::File::create("image.png").unwrap();
reqwest::blocking::get("https://example.com/image.png")
.unwrap()
.copy_to(&mut file)
.unwrap();
}
Add error handling at your convenience.
@erelde was using request::blocking::get not request::get. According to a documentation, copy_of is present in blocking version.
thanks a lot
@erelde 's solution is worked thanks a lot for helping
