Skip to content

Commit 4221fd4

Browse files
committed
[HttpClient] Allow to pass user/pw as an array
1 parent abae6bc commit 4221fd4

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

HttpClientInterface.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
interface HttpClientInterface
2727
{
2828
public const OPTIONS_DEFAULTS = [
29-
'auth_basic' => null, // string - a username:password enabling HTTP Basic authentication (RFC 7617)
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)
3032
'auth_bearer' => null, // string - a token enabling HTTP Bearer authorization (RFC 6750)
3133
'query' => [], // string[] - associative array of query string values to merge with the request's URL
3234
'headers' => [], // iterable|string[]|string[][] - headers names provided as keys or as part of values
@@ -37,16 +39,16 @@ interface HttpClientInterface
3739
// the JSON-encoded value and set the "content-type" headers to a JSON-compatible
3840
// value it is they are not defined - typically "application/json"
3941
'user_data' => null, // mixed - any extra data to attach to the request (scalar, callable, object...) that
40-
// MUST be available via $response->getInfo('data') - not used internally
42+
// MUST be available via $response->getInfo('data') - not used internally
4143
'max_redirects' => 20, // int - the maximum number of redirects to follow; a value lower or equal to 0 means
42-
// redirects should not be followed; "Authorization" and "Cookie" headers MUST
43-
// NOT follow except for the initial host name
44+
// redirects should not be followed; "Authorization" and "Cookie" headers MUST
45+
// NOT follow except for the initial host name
4446
'http_version' => null, // string - defaults to the best supported version, typically 1.1 or 2.0
4547
'base_uri' => null, // string - the URI to resolve relative URLs, following rules in RFC 3986, section 2
4648
'buffer' => true, // bool - whether the content of the response should be buffered or not
4749
'on_progress' => null, // callable(int $dlNow, int $dlSize, array $info) - throwing any exceptions MUST abort
48-
// the request; it MUST be called on DNS resolution, on arrival of headers and on
49-
// completion; it SHOULD be called on upload/download of data and at least 1/s
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
5052
'resolve' => [], // string[] - a map of host to IP address that SHOULD replace DNS resolution
5153
'proxy' => null, // string - by default, the proxy-related env vars handled by curl SHOULD be honored
5254
'no_proxy' => null, // string - a comma separated list of hosts that do not require a proxy to be reached

0 commit comments

Comments
 (0)