I want to make an http post to a server URL using GuzzleHTTP. My application is built with Laravel and the guzzle request requires a CSRF token. I've tried a few ways to include it but it isn't working. What is the proper way to include the CSRF token in a guzzle request? Here is my code:
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(url('/import'), [
'headers' => [
'X-CSRF-Token' => csrf_token()
]
]);
POST
data as_token
? – Tim Lewis