Skip to content

Instantly share code, notes, and snippets.

@beingsane
Forked from isaqueprofeta/guzzlelaravel.php
Created April 17, 2020 18:25
Show Gist options
  • Save beingsane/1a51c05548da97591a20cfbab13765a1 to your computer and use it in GitHub Desktop.
Save beingsane/1a51c05548da97591a20cfbab13765a1 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