8000 [HttpClient] Improve default content-type handling by nicolas-grekas · Pull Request #45812 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpClient] Improve default content-type handling #45812

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
Mar 23, 2022

Conversation

nicolas-grekas
Copy link
Member
Q A
Branch? 6.1
Bug fix? no
New feature? yes (minor)
Deprecations? no
Tickets -
License MIT
Doc PR -

This improves the default behavior of handling the content-type header: with this PR, when an array is passed as body, the content-type is forced to application/x-www-form-urlencoded.

This allows setting a content-type in the default options and have it overridden when passing an array as body.

Spotted while reviewing #45791, where the proposed behavior would have allowed a cleaner patch.

@fabpot
Copy link
Member
fabpot commented Mar 23, 2022

Thank you @nicolas-grekas.

8000

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.

4 participants
0