82b86ab060c46336107d9ec65aef9bcee8a9d60b
[mdref/mdref-http] / http / Client / Curl.md
1 # namespace http\Client\Curl
2
3 The http\Client\Curl namespace holds option value constants specific to the curl driver of the http\Client.
4
5 ## Changelog
6
7 Version | Change
8 --------|-------
9 2.1.0 | Added $dns_interface, $dns_local_ip4, $dns_local_ip6 options, $expect_100_timeout.
10 2.1.2 | Added request option constants:<br> http\Client\Curl::POSTREDIR_303,<br> http\Client\Curl::AUTH_SPNEGO,<br> http\Client\Curl::SSL_VERSION_TLSv1_0,<br> http\Client\Curl::SSL_VERSION_TLSv1_1 and<br> http\Client\Curl::SSL_VERSION_TLSv1_2
11
12 ## Constants:
13
14 ### HTTP Protocol Version
15
16 * HTTP_VERSION_1_0
17 Use HTTP/1.0 protocol version.
18 * HTTP_VERSION_1_1
19 Use HTTP/1.1 protocol version.
20 * HTTP_VERSION_ANY
21 Use any HTTP protocol version.
22
23 ### SSL Protocol Version
24
25 * SSL_VERSION_TLSv1_0
26 Use TLS v1.0 encryption.
27 * SSL_VERSION_TLSv1_1
28 Use TLS v1.1 encryption.
29 * SSL_VERSION_TLSv1_2
30 Use TLS v1.2 encryption.
31 * SSL_VERSION_TLSv1
32 Use any TLS v1 encryption.
33 * SSL_VERSION_SSLv2
34 Use SSL v2 encryption.
35 * SSL_VERSION_SSLv3
36 Use SSL v3 encryption.
37 * SSL_VERSION_ANY
38 Use any encryption.
39
40 ### DNS IP Version
41
42 * IPRESOLVE_V4
43 Use IPv4 resolver.
44 * IPRESOLVE_V6
45 Use IPv6 resolver.
46 * IPRESOLVE_ANY
47 Use any resolver.
48
49 ### Authentication Type
50
51 * AUTH_BASIC
52 Use Basic authentication.
53 * AUTH_DIGEST
54 Use Digest authentication.
55 * AUTH_DIGEST_IE
56 Use IE (lower v7) quirks with Digest authentication. Available if libcurl is v7.19.3 or more recent.
57 * AUTH_NTLM
58 Use NTLM authentication.
59 * AUTH_GSSNEG
60 Use GSS-Negotiate authentication.
61 * AUTH_SPNEGO
62 Use HTTP Netgotiate authentication (SPNEGO, RFC4559). Available if libcurl is v7.38.0 or more recent.
63 * AUTH_ANY
64 Use any authentication.
65
66 ### Proxy Protocol Version
67
68 * PROXY_SOCKS4
69 Use SOCKSv4 proxy protocol.
70 * PROXY_SOCKS4A
71 Use SOCKSv4a proxy protocol.
72 * PROXY_SOCKS5_HOSTNAME
73 Use SOCKS5h proxy protocol.
74 * PROXY_SOCKS5
75 Use SOCKS5 proxy protoccol.
76 * PROXY_HTTP
77 Use HTTP/1.1 proxy protocol.
78 * PROXY_HTTP_1_0
79 Use HTTP/1.0 proxy protocol. Available if libcurl is v7.19.4 or more recent.
80
81 ### POST Redirection Behavior
82
83 * POSTREDIR_301
84 Keep POSTing on 301 redirects. Available if libcurl is v7.19.1 or more recent.
85 * POSTREDIR_302
86 Keep POSTing on 302 redirects. Available if libcurl is v7.19.1 or more recent.
87 * POSTREDIR_303
88 Keep POSTing on 303 redirects. Available if libcurl is v7.19.1 or more recent.
89 * POSTREDIR_ALL
90 Keep POSTing on any redirect. Available if libcurl is v7.19.1 or more recent.
91
92
93 ## Options:
94
95 The option names used here are more or less derived from the corresponding CURLOPT_* names.
96 ### HTTP
97
98 * int $protocol
99 The HTTP protocol version. See http\Client\Curl::HTTP_VERSION_* constants.
100
101 ### Proxies
102
103 * string $proxyhost
104 The hostname of the proxy.
105 * int $proxytype
106 See http\Client\Curl::PROXY_* constants.
107 * int $proxyport
108 The port number of the proxy.
109 * string $proxyauth
110 user:password
111 * int $proxyauthtype
112 See http\Client\Curl::AUTH_* constants.
113 * bool $proxytunnel
114 Tunnel all operations through the proxy.
115 * string $noproxy
116 Comma separated list of hosts where no proxy should be used. Available if libcurl is v7.19.4 or more recent.
117
118 ### DNS
119
120 * int $dns_cache_timeout
121 Resolved hosts will be kept fot this number of seconds.
122 * int $ipresolve
123 See http\Client\Curl::IPRESOLVE_* constants.
124 * array $resolve
125 A list of HOST:PORT:ADDRESS mappings which pre-populate the DNS cache. Available if libcurl is v7.21.3 or more recent.
126 * string $dns_servers
127 Comma separated list of custom DNS servers of the form HOST[:PORT]. Available if libcurl is v7.24.0 or more recent and has built-in c-ares support.
128 * string $dns_interface
129 The name of the network interface ***name*** that the DNS resolver should bind to. Available if libcurl is v7.33.0 or more recent and has built-in c-ares support.
130 * string $dns_local_ip4
131 The local IPv4 ***address*** that the resolver should bind to. Available if libcurl is v7.33.0 or more recent and has built-in c-ares support.
132 * string $dns_local_ip6
133 The local IPv6 ***address*** that the resolver should bind to. Available if libcurl is v7.33.0 or more recent and has built-in c-ares support.
134
135 ### Limits
136
137 * int $low_speed_limit
138 Minimum speed in bytes per second.
139 * int $low_speed_time
140 Maximum time in seconds the transfer can be below $low_speed_limit before cancelling.
141 * int $maxfilesize
142 Maximum download size.
143
144 ### Connection handling
145
146 * bool $fresh_connect
147 Force a new connection.
148 * bool $forbid_reuse
149 Force closing the connection.
150
151 ### Networking
152
153 * string $interface
154 Outgoing interface name.
155 * array $portrange
156 A tuple of min/max ports.
157 * int $port
158 Override the URL's port.
159 * int $address_scope
160 RFC4007 zone_id. Available if libcurl is v7.19.0 or more recent.
161 * bool $tcp_keepalive
162 Whether to use TCP keepalive. Available if libcurl is v7.25.0 or more recent.
163 * int $tcp_keepidle
164 Seconds to wait before sending keepalive probes. Available if libcurl is v7.25.0 or more recent.
165 * int $tcp_keepintvl
166 Interval in seconds to wait between sending keepalive probes. Available if libcurl is v7.25.0 or more recent.
167 * bool $tcp_nodelay
168 Disable [Nagle's algotrithm](http://tools.ietf.org/html/rfc896).
169
170 ### Authentication
171
172 * string $httpauth
173 user:password
174 * int $httpauthtype
175 See http\Client\Curl::AUTH_* constants.
176
177 ### Redirection
178
179 * int $redirect
180 How many redirects to follow.
181 * bool $unrestricted_auth
182 Whether to keep sending authentication credentials on redirects to different hosts.
183 * int $postredir
184 See http\Client\Curl::POSTREDIR_* constants. Available if libcurl is v7.19.1 or more recent.
185
186 ### Retries
187
188 * int $retrycount
189 Retry this often.
190 * float $retrydelay
191 Pause this number of seconds between retries.
192
193 ### Special headers
194
195 * string $referer
196 Custom Referer header.
197 * bool $autoreferer
198 Whether to automatically send referers.
199 * string $useragent
200 Custom User-Agent header.
201 * string $etag
202 Custom ETag.
203 * bool $compress
204 Whether to request compressed content (through Accept-Encoding).
205 * int $lastmodified
206 Custom If-(Un)Modified since time. If less than zero, the current time will be added.
207
208 ### Resume/Ranges
209
210 * int $resume
211 Resume from this byte offset.
212 * array $range
213 Fetch specific ranges (if server supports byte ranges).
214
215 ### Cookies
216
217 * bool $encodecookies
218 Whether to URLencode cookies.
219 * array $cookies
220 List of custom cookies in the form ["name" => "value"].
221 * bool $cookiesession
222 Ignore previous session cookies to be loaded from $cookiestore.
223 * string $cookiestore
224 Path to a Netscape cookie file, from which cookies will be loaded resp. to which cookies will be written.
225
226 ### Timeouts
227
228 * float $timeout
229 Seconds the complete transfer may take.
230 * float $connecttimeout
231 Seconds the connect may take.
232 * float $expect_100_timeout
233 Senconds to wait for the server to send a response to "Expect: 100-Continue" before just proceeding with the request. Available if libcurl is v7.36.0 or more recent.
234
235 ### SSL
236
237 * array $ssl
238 Subarray of SSL related options:
239 * string $cert
240 SSL certificate file.
241 * string $certtype
242 Certificate type (DER, PEM). (Secure Transport additionally supports P12).
243 * string $key
244 Private key file.
245 * string $keytype
246 PK type (PEM, DER, ENG).
247 * string $keypasswd
248 The password for the private key.
249 * string $engine
250 Crypto engine to use for the private key.
251 * int $version
252 See http\Client\Curl::SSL_VERSION_* constants.
253 * bool $verifypeer
254 Whether to apply peer verification.
255 * bool $verifyhost
256 Whether to apply host verification.
257 * string $cipher_list
258 One or more cipher strings separated by colons.
259 * string $cainfo
260 CA bundle to verify the peer with.
261 * string $capath
262 Directory with prepared CA certs to verify the peer with.
263 * string $random_file
264 A file used to read from to seed the random engine.
265 * string $egdsocket
266 A Entropy Gathering Daemon socket.
267 * string $issuercert
268 CA PEM cert for peer verification. Available if libcurl is v7.19.0 or more recent.
269 * string $crlfile
270 File with the concatenation of CRL in PEM format. Available if libcurl was built with OpenSSL support.
271 * bool $certinfo
272 Enable gathering of SSL certificate chain information. Available if libcurl is v7.19.1 or more recent.