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