I am trying to use Guzzle client to post requests to an API, and I am getting an error message saying,
InvalidArgumentException: "No method is configured to handle the form_params config key"
This is what I have tried:
$response = $this->guzzle->post("https://example.com",[
'form_params'=> [
'client_id'=>$this->client_id,
'authorization_code'=>$this->authorization_code,
'decoder_query'=> $this->requestQuery
],
]
);
$this->requestQuery is a JSON request.
$response = $this->guzzle->post("https://example.com", [
'body' => [
'client_id' => $this->client_id,
'authorization_code'=> $this->authorization_code,
'decoder_query' => json_encode($this->requestQuery),
]
]);
with this syntax I am getting it woking..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With