-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #46583 [HttpClient] Copy as curl fixes (HypeMC)
This PR was squashed before being merged into the 6.1 branch. Discussion ---------- [HttpClient] Copy as curl fixes | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - The "Copy as curl" button doesn't work as expected in some cases: 1) it ignores the `query` option: ```php $httpClient->request('GET', 'https://symfony.com?foo=fooval&bar=barval', [ 'query' => [ 'bar' => 'newbarval', 'foobar' => [ 'baz' => 'bazval', 'qux' => 'quxval', ], ], ]); ``` ``` curl \ --compressed \ --request GET \ --url 'https://symfony.com?foo=fooval&bar=barval' \ --header 'accept: */*' \ --header 'user-agent: Symfony HttpClient/Curl' \ --header 'accept-encoding: gzip' ``` 2) it fails if the body is a multidimensional array or object: ```php $httpClient->request('POST', 'https://symfony.com', [ 'body' => [ 'bar' => 'newbarval', 'foobar' => [ 'baz' => 'bazval', 'qux' => 'quxval', ], 'bazqux' => ['bazquxval1', 'bazquxval2'], ], ]); ``` ``` Warning: Array to string conversion ``` Commits ------- 0bc7caf [HttpClient] Copy as curl fixes
- Loading branch information
Showing
2 changed files
with
48 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters