How to Download A Png Image from Web Using Reqwest

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();
        .copy_to(&mut file)

Add error handling at your convenience.

should I enable a optional feature to use the copy_to method

@jRimbault was using request::blocking::get not request::get. According to a documentation, copy_of is present in blocking version.

thanks a lot

@jRimbault 's solution is worked thanks a lot for helping