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

..03-May-2022-

Data/H18-Jun-2020-326216

Network/HTTP/H18-Jun-2020-4,0842,470

publicsuffixlist/Network/PublicSuffixList/H18-Jun-2020-208119

test/H18-Jun-2020-9983

test-nonet/H18-Jun-2020-806695

ChangeLog.mdH A D18-Jun-202010 KiB342191

LICENSEH A D18-Jun-20201.1 KiB2116

README.mdH A D18-Jun-20201.2 KiB4030

Setup.hsH A D18-Jun-202046 32

http-client.cabalH A D18-Jun-20205.2 KiB143132

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