I'll keep it simple:
I'd like to download a file via HTTPS; methods I've tried haven't worked (Network.HTTP.Wget, Network.Curl, Network.Download).
Suggestions?
Thanks!
HTTPS doesn't mean safe. Many people assume that an HTTPS connection means that the site is secure. In fact, HTTPS is increasingly being used by malicious sites, especially phishing ones.
Yes, there are plenty of security concerns with downloading over unencrypted lines. But if you must download content over unencrypted http, as is still done for some package repos, you need at least to verify the file you download in some other way.
Hypertext transfer protocol, or HTTP, and file transfer protocol, known as FTP, are two methods that allow you to upload or download files and pages from the Internet. The two have overlapping functions, and you can use either method to transfer files online.
When a user clicks a download link and tries to download files, thebrowser sends an HTTP GET request to the web server. At the sametime the file name to be downloaded and the file location are alsosent with the HTTP GET request.
See the http-enumerator, it works with SSL as well as enumerator/iteratee IO (with the enumerator package). Hence you can pipe it into attoparsec via attoparsec-iterator and efficiently parse the data.
This question comes up every once in a while:
The solution I use currently is:
import Network.HTTP.Conduit
import qualified Data.ByteString.Lazy as L
main = simpleHttp "https://www.noisebridge.net/wiki/Noisebridge" >>= L.putStr
There is also an explanation of how to post with http-conduit in the link as well as a few answers with other methods.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With