I am struggling to make this cURL request in Laravel
curl -d \'{\"key1\":\"value1\", \"key2\":\"value2\"}\' -H \"Content-Type: application/json\" -X GET http:/
You have forgotten to add \ before namespace.
You should write:
$response = $client->post($endpoint, [
\GuzzleHttp\RequestOptions::JSON => ['key1' => $id, 'key2' => 'Test'],
]);
Instead of:
$response = $client->post($endpoint, [
GuzzleHttp\RequestOptions::JSON => ['key1' => $id, 'key2' => 'Test'],
]);