Clarify setting useragent to empty string
[mdref/mdref-http] / http / Client / Curl.md
index d0f692b751cecb19a23a3510a9619a08b0c4974f..afc578ce55912138ac426e796142ec8d83843560 100644 (file)
@@ -2,6 +2,14 @@
 
 The http\Client\Curl namespace holds option value constants specific to the curl driver of the http\Client.
 
+## Changelog
+
+Version | Change
+--------|-------
+2.1.0   | Added $dns_interface, $dns_local_ip4, $dns_local_ip6 and $expect_100_timeout options.
+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 
+2.3.0   | Added $pinned_publickey, $ltsauth and $verifystatus $ssl options.<br>Added $proxyheader and $unix_socket_path options.<br>Added request option constants:<br>http\Client\Curl\HTTP_VERSION_2_0 and<br>http\Client\Curl\TLS_AUTH_SRP.
+
 ## Constants:
 
 ### HTTP Protocol Version
@@ -10,20 +18,33 @@ The http\Client\Curl namespace holds option value constants specific to the curl
   Use HTTP/1.0 protocol version.
 * HTTP_VERSION_1_1  
   Use HTTP/1.1 protocol version.
+* HTTP_VERSION_2_0  
+  Use HTTP/2 protocol version. Available if libcurl is v7.33.0 or more recent and was built with nghttp2 support.
 * HTTP_VERSION_ANY  
   Use any HTTP protocol version.
   
 ### SSL Protocol Version
 
+* SSL_VERSION_TLSv1_0  
+  Use TLS v1.0 encryption.
+* SSL_VERSION_TLSv1_1  
+  Use TLS v1.1 encryption.
+* SSL_VERSION_TLSv1_2  
+  Use TLS v1.2 encryption.
 * SSL_VERSION_TLSv1  
-  Use TLSv1 encryption.
+  Use any TLS v1 encryption.
 * SSL_VERSION_SSLv2  
-  Use SSLv2 encryption.
+  Use SSL v2 encryption.
 * SSL_VERSION_SSLv3  
-  Use SSLv3 encryption.
+  Use SSL v3 encryption.
 * SSL_VERSION_ANY  
   Use any encryption.
 
+### TLS Auth Types
+
+* TLS_AUTH_SRP  
+  Use TLS SRP authentication. Available if libcurl is v7.21.4 or more recent and was built with gnutls or openssl with TLS-SRP support.
+
 ### DNS IP Version
 
 * IPRESOLVE_V4  
@@ -45,6 +66,8 @@ The http\Client\Curl namespace holds option value constants specific to the curl
   Use NTLM authentication.
 * AUTH_GSSNEG  
   Use GSS-Negotiate authentication.
+* AUTH_SPNEGO  
+  Use HTTP Netgotiate authentication (SPNEGO, RFC4559). Available if libcurl is v7.38.0 or more recent.
 * AUTH_ANY  
   Use any authentication.
 
@@ -69,50 +92,61 @@ The http\Client\Curl namespace holds option value constants specific to the curl
   Keep POSTing on 301 redirects. Available if libcurl is v7.19.1 or more recent.
 * POSTREDIR_302  
   Keep POSTing on 302 redirects. Available if libcurl is v7.19.1 or more recent.
+* POSTREDIR_303  
+  Keep POSTing on 303 redirects. Available if libcurl is v7.19.1 or more recent.
 * POSTREDIR_ALL  
   Keep POSTing on any redirect. Available if libcurl is v7.19.1 or more recent.
 
 
 ## Options:
 
+The option names used here are more or less derived from the corresponding CURLOPT_* names.
 ### HTTP
 
 * int $protocol  
-  The HTTP protocol version. See http\Client\Curl::HTTP_VERSION_* constants.
+  The HTTP protocol version. See http\Client\Curl\HTTP_VERSION_* constants.
 
 ### Proxies
 
 * string $proxyhost  
   The hostname of the proxy.
 * int $proxytype  
-  See http\Client\Curl::PROXY_* constants.
+  See http\Client\Curl\PROXY_* constants.
 * int $proxyport  
   The port number of the proxy.
 * string $proxyauth  
   user:password
 * int $proxyauthtype  
-  See http\Client\Curl::AUTH_* constants.
+  See http\Client\Curl\AUTH_* constants.
 * bool $proxytunnel  
   Tunnel all operations through the proxy.
 * string $noproxy  
   Comma separated list of hosts where no proxy should be used. Available if libcurl is v7.19.4 or more recent.
+* array $proxyheader  
+  List of key/value pairs of headers which should only be sent to a proxy. Available if libcurl is v7.37.0 or more recent.
 
 ### DNS
 
 * int $dns_cache_timeout  
   Resolved hosts will be kept fot this number of seconds.
 * int $ipresolve  
-  See http\Client\Curl::IPRESOLVE_* constants.
+  See http\Client\Curl\IPRESOLVE_* constants.
 * array $resolve  
   A list of HOST:PORT:ADDRESS mappings which pre-populate the DNS cache. Available if libcurl is v7.21.3 or more recent.
 * string $dns_servers  
-  Comma separated list of custom DNS servers of the form HOST[:PORT]. Available if libcurl is v7.24.0 or more recent.
-  
+  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.
+* string $dns_interface  
+  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.
+* string $dns_local_ip4  
+  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.
+* string $dns_local_ip6  
+  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.
+
 ### Limits
 
 * int $low_speed_limit  
   Minimum speed in bytes per second.
-* int $low_speed_time
+* int $low_speed_time  
   Maximum time in seconds the transfer can be below $low_speed_limit before cancelling.
 * int $maxfilesize  
   Maximum download size.
@@ -140,13 +174,17 @@ The http\Client\Curl namespace holds option value constants specific to the curl
   Seconds to wait before sending keepalive probes. Available if libcurl is v7.25.0 or more recent.
 * int $tcp_keepintvl  
   Interval in seconds to wait between sending keepalive probes. Available if libcurl is v7.25.0 or more recent.
+* bool $tcp_nodelay  
+  Disable [Nagle's algotrithm](http://tools.ietf.org/html/rfc896).
+* string $unix_socket_path  
+  Connect to the webserver listening at $unix_socket_path instead of opening a TCP connection to it. Available if libcurl is v7.40.0 or more recent.
 
 ### Authentication
 
 * string $httpauth  
   user:password
 * int $httpauthtype  
-  See http\Client\Curl::AUTH_* constants.
+  See http\Client\Curl\AUTH_* constants.
 
 ### Redirection
 
@@ -155,7 +193,7 @@ The http\Client\Curl namespace holds option value constants specific to the curl
 * bool $unrestricted_auth  
   Whether to keep sending authentication credentials on redirects to different hosts.
 * int $postredir  
-  See http\Client\Curl::POSTREDIR_* constants. Available if libcurl is v7.19.1 or more recent.
+  See http\Client\Curl\POSTREDIR_* constants. Available if libcurl is v7.19.1 or more recent.
 
 ### Retries
 
@@ -171,7 +209,7 @@ The http\Client\Curl namespace holds option value constants specific to the curl
 * bool $autoreferer  
   Whether to automatically send referers.
 * string $useragent  
-  Custom User-Agent header.
+  Custom User-Agent header. Setting this option to NULL will use the default user agent, use the empty string to prevent this header being sent at all.
 * string $etag  
   Custom ETag.
 * bool $compress  
@@ -203,6 +241,8 @@ The http\Client\Curl namespace holds option value constants specific to the curl
   Seconds the complete transfer may take.
 * float $connecttimeout  
   Seconds the connect may take.
+* float $expect_100_timeout  
+  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.
 
 ### SSL
 
@@ -221,7 +261,7 @@ The http\Client\Curl namespace holds option value constants specific to the curl
   * string $engine  
     Crypto engine to use for the private key.
   * int $version  
-    See http\Client\Curl::SSL_VERSION_* constants.
+    See http\Client\Curl\SSL_VERSION_* constants.
   * bool $verifypeer  
     Whether to apply peer verification.
   * bool $verifyhost  
@@ -242,4 +282,36 @@ The http\Client\Curl namespace holds option value constants specific to the curl
     File with the concatenation of CRL in PEM format. Available if libcurl was built with OpenSSL support.
   * bool $certinfo  
     Enable gathering of SSL certificate chain information. Available if libcurl is v7.19.1 or more recent.
-
+  * string $pinned_publickey  
+    File with a public key to pin. Available if libcurl is v7.39.0 or more recent.
+  * int $tlsauthtype  
+    TLS_AUTH_* constant. Available if libcurl is v7.21.4 or more recent.
+  * string $tlsauthuser  
+    TLS-SRP username. Available if libcurl is v7.21.4 or more recent.
+  * string $lsauthpass  
+    TLS-SRP password. Available if libcurl is v7.21.4 or more recent.
+  * bool $verifystatus  
+    Enable OCSP. Available if libcurl is v7.41.0 or more recent and was build with openssl, gnutls or nss support.
+
+## Configuration:
+
+* int $maxconnects  
+  Size of the connection cache.
+* int $max_host_connections  
+  Maximum number of connections to a single host. Available if libcurl is v7.30.0 or more recent.
+* int $max_pipeline_length  
+  Maximum number of requests in a pipeline. Available if libcurl is v7.30.0 or more recent.
+* int $max_total_connections  
+  Maximum number of simultaneous open connections of this client. Available if libcurl is v7.30.0 or more recent.
+* bool $pipelining  
+  Whether to enable HTTP/1.1 pipelining.
+* int $chunk_length_penalty_size  
+  Chunk length threshold for pipelining; no more requests on this pipeline if exceeded. Available if libcurl is v7.30.0 or more recent.
+* int $content_length_penalty_size  
+  Size threshold for pipelining; no more requests on this pipeline if exceeded. Available if libcurl is v7.30.0 or more recent.
+* array $pipelining_server_bl  
+  Simple list of server software names to blacklist for pipelining. Available if libcurl is v7.30.0 or more recent.
+* array $pipelining_site_bl  
+  Simple list of server host names to blacklist for pipelining. Available if libcurl is v7.30.0 or more recent.
+* bool $use_eventloop  
+  Whether to use an event loop. Available if pecl/http was built with libevent support.