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