Laravel POST requests with Guzzle
Feb 082016First, set the right namespace to use.
1
use GuzzleHttp\Client;
Then, create a new GuzzleHttp instance:
1
$client = new Client;
Then, create the request and execute it.
PHP
1
2
3
4
5
$r = $client->post('https://api.apiprovider.com:9900/create_task',
['json' => [
"access_token" =>"thats a secret!",
"another_payload" => $aVariable
]]);