Goutte icon indicating copy to clipboard operation
Goutte copied to clipboard

POST request not working properly.

Open farazirfan47 opened this issue 7 years ago • 2 comments

I am sending POST request to "https://www.jkeats.com/sys/ajax/item/getprice" with parameters, here is my code. Parameters = $postData = [ 'form_params' => [ 'item' => 'NT-V-VNB241', 'language' => 'english', ]]; Request : $crawler = $client->request('POST', $price_url, $postData); In this way guzzle does not send parameters, but when I change $postData to $postData = [ 'item' => 'NT-V-VNB241', 'language' => 'english', ]; it worked. I don't know what the issue was when I send data inside form_params array, Please Advice. Thanks

farazirfan47 avatar Jan 04 '18 09:01 farazirfan47

I have the same issue. Thanks for advice!

dimzeta avatar Dec 01 '19 21:12 dimzeta

I experience the same, which also means that the query parameters are not taken into account. Something like

$params = [
    'query' => ['param1' => $myValue],
];

would not work while attaching these parameters in the URL will work...

EDIT: This is because Goutte no longer relies on Guzzle so we should not expect the same syntax... I ended up manually building my url with the parameters.

Schyzophrenic avatar Aug 08 '20 19:08 Schyzophrenic