• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

Data/H22-Oct-2019-326216

Network/HTTP/H22-Oct-2019-4,0362,449

publicsuffixlist/Network/PublicSuffixList/H22-Oct-2019-208119

test/H22-Oct-2019-9983

test-nonet/H22-Oct-2019-769662

ChangeLog.mdH A D09-Mar-20209.8 KiB334187

LICENSEH A D22-Oct-20191.1 KiB2116

README.mdH A D22-Oct-20191.2 KiB4030

Setup.hsH A D22-Oct-201946 32

http-client.cabalH A D09-Mar-20205.2 KiB142131

README.md

1http-client
2===========
3
4Full tutorial docs are available at:
5https://github.com/snoyberg/http-client/blob/master/TUTORIAL.md
6
7An HTTP client engine, intended as a base layer for more user-friendly packages.
8
9This codebase has been refactored from [http-conduit](http://www.stackage.org/package/http-conduit).
10
11Note that, if you want to make HTTPS secure connections, you should use
12[http-client-tls](https://www.stackage.org/package/http-client-tls) in addition
13to this library.
14
15Below is a series of cookbook recipes. A number of recipes exist elsewhere,
16including `Network.HTTP.Client` and `Network.HTTP.Conduit`. The goal is to
17expand this list over time.
18
19## Proxy environment variable
20
21Use the following approach to get proxy settings from the `http_proxy` and
22`https_proxy` environment variables.
23
24```haskell
25{-# LANGUAGE OverloadedStrings #-}
26import Network.HTTP.Client
27
28main :: IO ()
29main = do
30    let settings = managerSetProxy
31            (proxyEnvironment Nothing)
32            defaultManagerSettings
33    man <- newManager settings
34    let req = "http://httpbin.org"
35            -- Note that the following settings will be completely ignored.
36            { proxy = Just $ Proxy "localhost" 1234
37            }
38    httpLbs req man >>= print
39```
40