This module contains a very basic HTTP client. At the moment, it doesn't even handle redirects for you.
Note that, in order to use SSL, you need to have the root CA certificates
in a PEM file in etcssh/certs.pem
and you need to have wrapped your
main function in OpenSSL.withOpenSSL
Documentation
:: Headers | the headers to use. This function will set the Host
header for you in the case that the URL has a
hostname in it. If in doubt, use |
-> URL | the resource to fetch |
-> IO (Connection, Reply, Maybe Source) | the connection (which you have to close once you are done
reading the |
Fetch an HTTP(S) entity.
connection :: URL -> IO SocketSource
Construct a connection to the correct host for the given URL. (i.e. resolve the hostname and create a TCP connection to the correct port).
Note that the DNS resolution (if any) doesn't block the whole process.