Skip to content

Commit 71b69a2

Browse files
authored
Update docs (#11)
1 parent 433f1a9 commit 71b69a2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ Maybe, just maybe, this is for you.
1919
```php
2020
use GuzzleHttp\Client;
2121
use GuzzleHttp\HandlerStack;
22-
use webignition\Guzzle\Middleware\HttpAuthentication\HttpAuthenticationCredentials;
22+
use webignition\Guzzle\Middleware\HttpAuthentication\AuthorizationType;
23+
use webignition\Guzzle\Middleware\HttpAuthentication\BasicCredentials;
24+
use webignition\Guzzle\Middleware\HttpAuthentication\AuthorizationHeader;
2325
use webignition\Guzzle\Middleware\HttpAuthentication\HttpAuthenticationMiddleware;
2426

2527
// Creating a client that uses the middleware
@@ -33,8 +35,9 @@ $client = new Client([
3335
]);
3436

3537
// Setting credentials on the middleware
36-
$credentials = new HttpAuthenticationCredentials('username', 'password', 'example.com');
37-
$httpAuthenticationMiddleware->setHttpAuthenticationCredentials($credentials);
38+
$credentials = new BasicCredentials('username', 'password', 'example.com');
39+
$httpAuthenticationMiddleware->setType(AuthorizationType::BASIC);
40+
$httpAuthenticationMiddleware->setCredentials($credentials);
3841

3942
// All requests to example.com (or *.example.com) will now have
4043
// a correct Authorization header set for basic HTTP authentication

0 commit comments

Comments
 (0)