Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
[HttpClient] add note about getInfo(debug)#11632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -265,6 +265,10 @@ following methods:: | ||
| // you can get individual info too | ||
| $startTime = $response->getInfo('start_time'); | ||
| .. tip:: | ||
| Call ``$response->getInfo('debug')`` to get detailed logs about the HTTP transaction. | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. There should be an empty line between the start of the directive ( | ||
| .. _http-client-streaming-responses: | ||
| Streaming Responses | ||
| @@ -316,17 +320,25 @@ When the HTTP status code of the response is in the 300-599 range (i.e. 3xx, | ||
| Caching Requests and Responses | ||
| ------------------------------ | ||
| This component provides a :class:`Symfony\\Component\\HttpClient\\CachingHttpClient` | ||
| decorator that allows caching responses and serving them from the local storage | ||
| for next requests. The implementation leverages the | ||
| :class:`Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache` class under the hood | ||
| so that the :doc:`HttpKernel component </components/http_kernel>` needs to be | ||
| installed in your application:: | ||
| use Symfony\Component\HttpClient\HttpClient; | ||
| use Symfony\Component\HttpClient\CachingHttpClient; | ||
| use Symfony\Component\HttpKernel\HttpCache\Store; | ||
| $store = new Store('/path/to/cache/storage/'); | ||
| $client = HttpClient::create(); | ||
| $client = new CachingHttpClient($client, $store); | ||
| // this won't hit the network if the resource is already in the cache | ||
| $response = $client->request('GET', 'https://example.com/cacheable-resource'); | ||
| ``CachingHttpClient`` accepts a third argument to set the options of the ``HttpCache``. | ||
| Scoping Client | ||
| -------------- | ||