Guzzle - Laravel. How to make request with x-www-form-url-encoded
问题 I need to integrate an API so I write function: public function test() { $client = new GuzzleHttp\Client(); try { $res = $client->post('http://example.co.uk/auth/token', [ 'headers' => [ 'Content-Type' => 'application/x-www-form-urlencoded', ], 'json' => [ 'cliend_id' => 'SOMEID', 'client_secret' => '9999jjjj67Y0LBLq8CbftgfdreehYEI=', 'grant_type' => 'client_credentials' ] ]); $res = json_decode($res->getBody()->getContents(), true); dd($res); } catch (GuzzleHttp\Exception\ClientException $e)