-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[HttpClient] Add portable HTTP/2 implementation based on Amp's HTTP client #35115
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
Conversation
c81d7c1 to
40313c8
Compare
40313c8 to
17cee92
Compare
17cee92 to
a6dde3d
Compare
8b4f81a to
96b3fc5
Compare
|
Now with fixed redirection logic (not reusing the existing one from Amp because we want a different behavior that is consistent with curl+native) |
96b3fc5 to
287f2ba
Compare
287f2ba to
b0d6520
Compare
0713fbd to
e0537ca
Compare
100e79d to
ab72bba
Compare
fd7d7db to
787b074
Compare
|
PR is ready for final review! |
|
|
||
| /** | ||
| * @param array $defaultOptions Default requests' options | ||
| * @param int $maxHostConnections The maximum number of connections to open |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for such minor comment, but I don't get how phpDoc works here. There are 2 missing arguments here while documented ones don't add any valuable information (arguments' names are self-descriptive, they are typed). For me only @see adds something valuable here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback, all arguments are now documented.
|
Thank you @nicolas-grekas. |
| - SET SYMFONY_PHPUNIT_SKIPPED_TESTS=phpunit.skipped | ||
| - copy /Y c:\php\php.ini-min c:\php\php.ini | ||
| - IF %APPVEYOR_REPO_BRANCH% neq master (rm -Rf src\Symfony\Bridge\PhpUnit) | ||
| - mv src\Symfony\Component\HttpClient\phpunit.xml.dist src\Symfony\Component\HttpClient\phpunit.xml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To run the tests for the component separately: they block when run concurrently with other components, and we don't care as this doesn't happen in practice.
…pHttpClient` when `amphp/http-client` is found but curl is not or too old (nicolas-grekas) This PR was merged into the 5.1-dev branch. Discussion ---------- [HttpClient] make `HttpClient::create()` return an `AmpHttpClient` when `amphp/http-client` is found but curl is not or too old | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Follows #35115 Let's use `amphp/http-client` by default, after `curl` and before `fopen()`. Commits ------- 7991685 [HttpClient] made `HttpClient::create()` return an `AmpHttpClient` when `amphp/http-client` is found but curl is not or too old
…rately (xabbuh) This PR was merged into the 5.4 branch. Discussion ---------- add comment explaining why HttpClient tests are run separately | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT see #35115 and #58916 Commits ------- cbdb08a add comment explaining why HttpClient tests are run separately
This PR provides an
AmpHttpClient, which is an adapter betweenamphp/http-clientandsymfony/http-client-contracts.This is an early experiment for now, but it works already on the happy path:I have a local h2-intensive script, and while it's slower than CurlHttpClient, this performs quite well!This could provide a portable implementation of HTTP/2 \o/
/cc @kelunik FYI
Todo:
$response->toStream()Allow skipping the default interceptors in HttpClientBuilder amphp/http-client#241Fix CI kelunik/certificate#2