Skip to content

Instantly share code, notes, and snippets.

@isaqueprofeta
Created August 2, 2017 20:53
Show Gist options
  • Save isaqueprofeta/f5707b450ea97bbca1837189418b7b9d to your computer and use it in GitHub Desktop.
Save isaqueprofeta/f5707b450ea97bbca1837189418b7b9d to your computer and use it in GitHub Desktop.
use GuzzleHttp\Client;
class yourController extends Controller {
public function saveApiData()
{
$client = new Client();
$res = $client->request('POST', 'https://url_to_the_api', [
'form_params' => [
'client_id' => 'test_id',
'secret' => 'test_secret',
]
]);
$result= $res->getBody();
dd($result);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment