File: README.md

package info (click to toggle)
haskell-http-client 0.7.17-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 528 kB
  • sloc: haskell: 4,029; makefile: 3
file content (39 lines) | stat: -rw-r--r-- 1,254 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
http-client
===========

Full tutorial docs are available at:
https://github.com/snoyberg/http-client/blob/master/TUTORIAL.md

An HTTP client engine, intended as a base layer for more user-friendly packages.

This codebase has been refactored from [http-conduit](http://www.stackage.org/package/http-conduit).

Note that, if you want to make HTTPS secure connections, you should use
[http-client-tls](https://www.stackage.org/package/http-client-tls) in addition
to this library.

Below is a series of cookbook recipes. A number of recipes exist elsewhere,
including `Network.HTTP.Client` and `Network.HTTP.Conduit`. The goal is to
expand this list over time.

## Proxy environment variable

Use the following approach to get proxy settings from the `http_proxy` and
`https_proxy` environment variables.

```haskell
{-# LANGUAGE OverloadedStrings #-}
import Network.HTTP.Client

main :: IO ()
main = do
    let settings = managerSetProxy
            (proxyEnvironment Nothing)
            defaultManagerSettings
    man <- newManager settings
    let req = "http://httpbin.org"
            -- Note that the following settings will be completely ignored.
            { proxy = Just $ Proxy "localhost" 1234
            }
    httpLbs req man >>= print
```