26
26
interface HttpClientInterface
27
27
{
28
28
public const OPTIONS_DEFAULTS = [
29
- 'auth_basic ' => null , // array|string - an array containing the username as first value, and optionally the
30
- // password as the second one; or string like username:password - enabling HTTP Basic
31
- // authentication (RFC 7617)
32
- 'auth_bearer ' => null , // string - a token enabling HTTP Bearer authorization (RFC 6750)
33
- 'query ' => [], // string[] - associative array of query string values to merge with the request's URL
34
- 'headers ' => [], // iterable|string[]|string[][] - headers names provided as keys or as part of values
35
- 'body ' => '' , // array|string|resource|\Traversable|\Closure - the callback SHOULD yield a string
36
- // smaller than the amount requested as argument; the empty string signals EOF; when
37
- // an array is passed, it is meant as a form payload of field names and values
38
- 'json ' => null , // array|\JsonSerializable - when set, implementations MUST set the "body" option to
39
- // the JSON-encoded value and set the "content-type" headers to a JSON-compatible
40
- // value if they are not defined - typically "application/json"
41
- 'user_data ' => null , // mixed - any extra data to attach to the request (scalar, callable, object...) that
42
- // MUST be available via $response->getInfo('user_data') - not used internally
43
- 'max_redirects ' => 20 , // int - the maximum number of redirects to follow; a value lower or equal to 0 means
44
- // redirects should not be followed; "Authorization" and "Cookie" headers MUST
45
- // NOT follow except for the initial host name
46
- 'http_version ' => null , // string - defaults to the best supported version, typically 1.1 or 2.0
47
- 'base_uri ' => null , // string - the URI to resolve relative URLs, following rules in RFC 3986, section 2
48
- 'buffer ' => true , // bool - whether the content of the response should be buffered or not
49
- 'on_progress ' => null , // callable(int $dlNow, int $dlSize, array $info) - throwing any exceptions MUST abort
50
- // the request; it MUST be called on DNS resolution, on arrival of headers and on
51
- // completion; it SHOULD be called on upload/download of data and at least 1/s
52
- 'resolve ' => [], // string[] - a map of host to IP address that SHOULD replace DNS resolution
53
- 'proxy ' => null , // string - by default, the proxy-related env vars handled by curl SHOULD be honored
54
- 'no_proxy ' => null , // string - a comma separated list of hosts that do not require a proxy to be reached
55
- 'timeout ' => null , // float - the inactivity timeout - defaults to ini_get('default_socket_timeout')
56
- 'bindto ' => '0 ' , // string - the interface or the local socket to bind to
57
- 'verify_peer ' => true , // see https://php.net/context.ssl for the following options
29
+ 'auth_basic ' => null , // array|string - an array containing the username as first value, and optionally the
30
+ // password as the second one; or string like username:password - enabling HTTP Basic
31
+ // authentication (RFC 7617)
32
+ 'auth_bearer ' => null , // string - a token enabling HTTP Bearer authorization (RFC 6750)
33
+ 'query ' => [], // string[] - associative array of query string values to merge with the request's URL
34
+ 'headers ' => [], // iterable|string[]|string[][] - headers names provided as keys or as part of values
35
+ 'body ' => '' , // array|string|resource|\Traversable|\Closure - the callback SHOULD yield a string
36
+ // smaller than the amount requested as argument; the empty string signals EOF; when
37
+ // an array is passed, it is meant as a form payload of field names and values
38
+ 'json ' => null , // array|\JsonSerializable - when set, implementations MUST set the "body" option to
39
+ // the JSON-encoded value and set the "content-type" headers to a JSON-compatible
40
+ // value if they are not defined - typically "application/json"
41
+ 'user_data ' => null , // mixed - any extra data to attach to the request (scalar, callable, object...) that
42
+ // MUST be available via $response->getInfo('user_data') - not used internally
43
+ 'max_redirects ' => 20 , // int - the maximum number of redirects to follow; a value lower or equal to 0 means
44
+ // redirects should not be followed; "Authorization" and "Cookie" headers MUST
45
+ // NOT follow except for the initial host name
46
+ 'http_version ' => null , // string - defaults to the best supported version, typically 1.1 or 2.0
47
+ 'base_uri ' => null , // string - the URI to resolve relative URLs, following rules in RFC 3986, section 2
48
+ 'buffer ' => true , // bool - whether the content of the response should be buffered or not
49
+ 'on_progress ' => null , // callable(int $dlNow, int $dlSize, array $info) - throwing any exceptions MUST abort
50
+ // the request; it MUST be called on DNS resolution, on arrival of headers and on
51
+ // completion; it SHOULD be called on upload/download of data and at least 1/s
52
+ 'resolve ' => [], // string[] - a map of host to IP address that SHOULD replace DNS resolution
53
+ 'proxy ' => null , // string - by default, the proxy-related env vars handled by curl SHOULD be honored
54
+ 'no_proxy ' => null , // string - a comma separated list of hosts that do not require a proxy to be reached
55
+ 'timeout ' => null , // float - the inactivity timeout - defaults to ini_get('default_socket_timeout')
56
+ 'transfer_timeout ' => null , // float|null - the total transfer timeout (including the inactivity timeout)
57
+ 'bindto ' => '0 ' , // string - the interface or the local socket to bind to
58
+ 'verify_peer ' => true , // see https://php.net/context.ssl for the following options
58
59
'verify_host ' => true ,
59
60
'cafile ' => null ,
60
61
'capath ' => null ,
@@ -64,7 +65,7 @@ interface HttpClientInterface
64
65
'ciphers ' => null ,
65
66
'peer_fingerprint ' => null ,
66
67
'capture_peer_cert_chain ' => false ,
67
- 'extra ' => [], // array - additional options that can be ignored if unsupported, unlike regular options
68
+ 'extra ' => [], // array - additional options that can be ignored if unsupported, unlike regular options
68
69
];
69
70
70
71
/**
0 commit comments