You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -313,6 +313,27 @@ Now all calls made by this library will appear in the Charles UI.
313
313
314
314
One additional step is required in Charles to view SSL requests. Go to **Charles > Proxy > SSL Proxying Settings** and add the domain you'd like captured. In the case of the Google APIs, this is usually `*.googleapis.com`.
Google API Client uses [Guzzle](http://docs.guzzlephp.org) as its default HTTP client. That means that you can control your HTTP requests in the same manner you would for any application using Guzzle.
319
+
320
+
Let's say, for instance, we wished to apply a referrer to each request.
321
+
322
+
```php
323
+
use GuzzleHttp\Client;
324
+
325
+
$httpClient = new Client([
326
+
'headers' => [
327
+
'referer' => 'mysite.com'
328
+
]
329
+
]);
330
+
331
+
$client = new Google_Client();
332
+
$client->setHttpClient($httpClient);
333
+
```
334
+
335
+
Other Guzzle features such as [Handlers and Middleware](http://docs.guzzlephp.org/en/stable/handlers-and-middleware.html) offer even more control.
0 commit comments