[Haskell-beginners] File download using wreq.

Mike Houghton mike_k_houghton at yahoo.co.uk
Sun Oct 4 15:18:17 UTC 2015


Hi,

Please can someone explain how,using the wreq package, I can download and save a binary file? 
Say the file is at the end of 
http://x.y.z/files/myfile.jpg

and it is a jpeg and no authentication is needed. 

I just want to 

1. Check that the URL is syntactically correct - flag and error if not
2. If the URL is syntactically ok then download the file using GET.
3. Check that the response code is 200 and if so save the file 
3a. if the response code is not 200 then delegate to an  error handling function or some simple idiomatic way of error handling.


Thanks once again.

Mike



More information about the Beginners mailing list