Skip to content

Commit de7b5ef

Browse files
authored
Update GraphClientFactory using in README.md
1 parent 124c5a5 commit de7b5ef

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,21 @@ sets some Guzzle config defaults such as connection and request timeouts, and th
4646
In the near future, the `GraphClientFactory` will provide some default middleware to use with the Graph API such as retry handlers.
4747

4848
```php
49-
use Microsoft\Graph\Core\Core\Http\GraphClientFactory;
49+
use Microsoft\Graph\Core\GraphClientFactory;
5050

5151
$guzzleConfig = [
5252
// your preferred guzzle config
5353
];
5454

55-
$httpClient = GraphClientFactory::setClientConfig($guzzleConfig)::create();
56-
55+
$httpClient = GraphClientFactory::createWithConfig($guzzleConfig);
5756
```
5857

5958
### 4. Call Microsoft Graph using the v1.0 endpoint
6059

6160
The following is an example that shows how to call Microsoft Graph.
6261

6362
```php
64-
use Microsoft\Graph\Core\Core\Http\GraphClientFactory;
63+
use Microsoft\Graph\Core\GraphClientFactory;
6564

6665
class UsageExample
6766
{
@@ -71,11 +70,11 @@ class UsageExample
7170

7271
$config = [
7372
'headers' => [
74-
'Authorization' => 'Bearer '.$accessToken
73+
'Authorization' => $accessToken
7574
]
7675
];
7776

78-
$httpClient = GraphClientFactory::setClientConfig($config)::create();
77+
$httpClient = GraphClientFactory::createWithConfig($config);
7978
$response = $httpClient->get("/v1.0/me");
8079
$currentUser = json_decode($response->getBody());
8180

0 commit comments

Comments
 (0)