Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[HttpClient] Prevent curl from sending its default Accept and Expect headers #33596

Copy link
Copy link
Closed
@numerogeek

Description

@numerogeek
Issue body actions

Hello,

I am currently dealing with a big account's API, and I figured out that when I send a specific request from POSTMAN it was working, but the very same request failed through the httpClient.

After hours of investigating, I figured out that the httpClient was setting default value for accept and except headers. (cf https://github.com/symfony/http-client/blob/master/CurlHttpClient.php#L245)

Adding the following lines fixed my problem:

 'headers' => [
                'Accept' => '*',
                'Expect' => '*',
]

But I'm wondering why have you coded this in the first place ?

Thank you

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.