-
Notifications
You must be signed in to change notification settings - Fork 70
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
Header Content-Type in options doesn't work #82
Comments
You are totally right. I will fix that asap. Example: guzzle:
clients:
test:
base_url: "testurl"
## START: DEPRECATED BUT WORKING APPROACH
headers:
Content-Type: "application/x-www-form-urlencoded; charset=utf-8"
## END: DEPRECATED BUT WORKING APPROACH
options:
auth:
- "username"
- "passwort"
verify: false
debug: true |
I try that too but that also doesn't work. |
I've tried it again and it works for me by using following code: guzzle:
logging: true
clients:
httpbin:
base_url: "https://httpbin.org"
headers:
Content-Type: "application/x-www-form-urlencoded; charset=utf-8"
options:
verify: false
debug: true Controller: public function indexAction(Request $request)
{
$client = $this->get('guzzle.client.httpbin');
$params = ['form_params'=> ['test' => 'aha']];
$response = $client->post('/post', $params);
$body = $response->getBody()->getContents();
var_dump($body); I used dev-master which is similar to latest stable version 5.2.1. |
Look at your Content-Type in Request, there's no charset only type |
You are right. Didn't saw that, sorry. So without using |
Fix: Content-Type in config.yml doesn't work #82
I created a new ticket regarding the override of content-type to split these two "bugs": #84 |
Fix: Content-Type in config.yml doesn't work #82
Released v5.2.2, fix: headers in options Issue with form_params and content-type will be continued in #84 |
i try to setup a handler in config.yml, but the "Content-Type" doesn't work in request.
config.yml:
Now when i call:
the charset is not set.
But when i set the headers in post-call:
The Charset is correct set
The text was updated successfully, but these errors were encountered: