Skip to content

[HttpClient] make $response->getInfo('debug') return extended logs about the HTTP transaction #31641

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2019

Conversation

nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented May 27, 2019

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

This maps the CURLOPT_VERBOSE mode of curl to the debug info and emulates it when using NativeHttpClient.

For example:

* Found bundle for host http2-push.io: 0x56193881ae40 [can multiplex]\n
* Re-using existing connection! (#0) with host http2-push.io\n
* Connected to http2-push.io (216.239.38.21) port 443 (#0)\n
* Using Stream ID: 3 (easy handle 0x5619388fcd50)\n
> GET /css/style.css HTTP/2\r\n
Host: http2-push.io\r\n
User-Agent: Symfony HttpClient/Curl\r\n
Accept-Encoding: deflate, gzip\r\n
\r\n
< HTTP/2 200 \r\n
< date: Mon, 27 May 2019 18:23:23 GMT\r\n
< expires: Mon, 27 May 2019 18:33:23 GMT\r\n
< etag: "0CqJow"\r\n
< x-cloud-trace-context: 543375291bd3b71b67fe389260ad1fbd;o=1\r\n
< content-type: text/css\r\n
< content-encoding: gzip\r\n
< server: Google Frontend\r\n
< content-length: 1805\r\n
< cache-control: public, max-age=600\r\n
< age: 0\r\n
< \r\n
* Connection #0 to host http2-push.io left intact\n

@fabpot fabpot changed the base branch from master to 4.3 May 28, 2019 08:25
@fabpot
Copy link
Member

fabpot commented May 28, 2019

Thank you @nicolas-grekas.

@fabpot fabpot merged commit 1214609 into symfony:4.3 May 28, 2019
fabpot added a commit that referenced this pull request May 28, 2019
…xtended logs about the HTTP transaction (nicolas-grekas)

This PR was submitted for the master branch but it was merged into the 4.3 branch instead (closes #31641).

Discussion
----------

[HttpClient] make $response->getInfo('debug') return extended logs about the HTTP transaction

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

This maps the `CURLOPT_VERBOSE` mode of curl to the `debug` info and emulates it when using `NativeHttpClient`.

For example:
```
* Found bundle for host http2-push.io: 0x56193881ae40 [can multiplex]\n
* Re-using existing connection! (#0) with host http2-push.io\n
* Connected to http2-push.io (216.239.38.21) port 443 (#0)\n
* Using Stream ID: 3 (easy handle 0x5619388fcd50)\n
> GET /css/style.css HTTP/2\r\n
Host: http2-push.io\r\n
User-Agent: Symfony HttpClient/Curl\r\n
Accept-Encoding: deflate, gzip\r\n
\r\n
< HTTP/2 200 \r\n
< date: Mon, 27 May 2019 18:23:23 GMT\r\n
< expires: Mon, 27 May 2019 18:33:23 GMT\r\n
< etag: "0CqJow"\r\n
< x-cloud-trace-context: 543375291bd3b71b67fe389260ad1fbd;o=1\r\n
< content-type: text/css\r\n
< content-encoding: gzip\r\n
< server: Google Frontend\r\n
< content-length: 1805\r\n
< cache-control: public, max-age=600\r\n
< age: 0\r\n
< \r\n
* Connection #0 to host http2-push.io left intact\n
```

Commits
-------

1214609 [HttpClient] make $response->getInfo('debug') return extended logs about the HTTP transaction
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.3 May 28, 2019
@nicolas-grekas nicolas-grekas deleted the hc-debug branch May 28, 2019 08:29
@fabpot fabpot mentioned this pull request May 28, 2019
weaverryan added a commit to symfony/symfony-docs that referenced this pull request May 31, 2019
…ekas, weaverryan)

This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] add note about getInfo(debug)

As implemented in symfony/symfony#31641

Commits
-------

0278830 fixing syntax
b05f9ca [HttpClient] add note about getInfo(debug)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants