Merge pull request #4 from trs998/patch-1
[mdref/mdref-http] / http.md
1 # pecl/http v2
2
3 ## About:
4
5 Extended HTTP support. Again.
6
7 * Introduces the http namespace.
8 * PHP stream based message bodies.
9 * Encapsulated env request/response.
10 * Modular client support.
11
12 ## Installation:
13
14 This extension is hosted at [PECL](http://pecl.php.net) and can be installed with [PEAR](http://pear.php.net)'s pecl command:
15
16 # pecl install pecl_http
17
18 ## Dependencies:
19
20 pecl/http depends on a number of system libraries and PHP extensions for special features.
21
22 #### Required system libraries:
23
24 The following system libraries are required to build this extension:
25
26 =zlib=
27 Provides gzip/zlib/deflate encoding.
28 Minimum version: 1.2.0.4
29 Install on Debian: `apt-get install zlib1g-dev`
30
31
32 #### Optional system libraries:
33
34 The following system libraries are optional and provide additional features:
35
36 =libidn=
37 Provides IDNA support in URLs.
38 Minimum version: none
39 Install on Debian: `apt-get install libidn11-dev`
40
41 =libidn2=
42 Provides IDNA support in URLs (fallback if libidn is not available).
43 Minimum version: none
44 Install on Debian: `apt-get install libidn2-0-dev`
45
46 =libicu=
47 Provides IDNA support in URLs (fallback if libidn is not available).
48 Minimum version: none
49 Install on Debian: `apt-get install libicu-dev`
50
51 =libcurl=
52 Provides HTTP request functionality.
53 Minimum version: 7.18.2
54 Install on Debian: `apt-get install libcurl4-openssl-dev`
55 Note: There are usually different styles of SSL support for libcurl available, so you can replace 'openssl' in the above command f.e. with 'nss' or 'gnutls'.
56
57 =libevent=
58 Eventloop support for the HTTP client.
59 Minimum version: none
60 Install on Debian: `apt-get install libevent-dev`
61
62 ### PHP extensions:
63
64 This extension unconditionally depends on the pre-loaded presence of the following PHP extensions:
65
66 * raphf
67 * propro
68 * spl
69
70
71 If configured ```--with-http-shared-deps``` (default) it depends on the pre-loaded presence of the following extensions, as long as they were available at build time:
72
73 * hash
74 * iconv
75 * json (only until < 2.4.0)
76
77 Please ensure that all extension on which pecl/http depends, are loaded before it, e.g in your `php.ini`:
78
79 ; obligatory deps
80 extension = raphf.so
81 extension = propro.so
82
83 ; if shared deps were enabled
84 extension = hash.so
85 extension = iconv.so
86 extension = json.so
87
88 ; finally load pecl/http
89 extension = http.so
90
91 ## Conflicts:
92
93 pecl/http-v2 conflicts with the following extensions:
94
95 * http-v1
96 * event (only until <= 2.0.3)
97
98 ## INI Directives:
99
100 * http.etag.mode = "crc32b"
101 Default hash method for dynamic response payloads to generate an ETag.
102
103 ## Stream Filters:
104
105 The http extension registers the ```http.*``` namespace for its stream filters. Provided stream filters are:
106
107 * http.chunked_decode
108 Decode a stream encoded with chunked transfer encoding.
109 * http.chunked_encode
110 Encode a stream with chunked transfer encoding.
111 * http.inflate
112 Decode a stream encoded with deflate/zlib/gzip encoding.
113 * http.deflate
114 Encode a stream with deflate/zlib/gzip encoding.
115
116 ## Changelog:
117
118 Version | Change
119 --------|-------
120 2.0.4 | Dropped the pecl/event conflict.
121 2.4.0 | Dropped the ext/json dependency.
122 2.4.2 | Added libidn2 and libicu as fallback for IDNA support.