8p / EightPointsGuzzleBundle

⛽️ Integrates Guzzle 6.x, a PHP HTTP Client, into Symfony
MIT License
440 stars 71 forks source link

How to set Header with dash #14

Closed sebastianblum closed 9 years ago

sebastianblum commented 9 years ago

Hello!

I want to add the header "Content-Type" and tried this configuration:

guzzle:
  clients:
    emailApi:
      base_url: %email_api.uri%
      headers:
        'Content-Type': "application/json"
      plugin:
         wsse:
           username: %username%

The debug toolbar tells me, that the header is Content_Typpe (with underscore).

How can I send a header with dash?

florianpreusner commented 9 years ago

Now your configuration should work, underscores are going to be converted back as dashes (underscores are also not allowed in HTTP standard). The processor is normalizing yaml keys because of yaml standard conventions: https://github.com/symfony/symfony/issues/7405

florianpreusner commented 7 years ago

Underscore are allowed now, take a look at following PR: https://github.com/8p/GuzzleBundle/pull/111