Question: I am struggling to make this cURL request in Laravel

```
curl -d '{"key1":"value1", "key2":"value2"}' -H "Content-Type: application/json"   -X GET http://my.domain.com/test.php

```

I've been trying this:

```
$endpoint = "http://my.domain.com/test.php";

$client = new \GuzzleHttp\Client();

$response = $client->post($endpoint, [
                GuzzleHttp\RequestOptions::JSON => ['key1' => $id, 'key2' => 'Test'],
            ]);

$statusCode = $response->getStatusCode();

```

But I am getting an error `Class 'App\Http\Controllers\GuzzleHttp\RequestOptions' not found`

Any suggestions?

**EDIT**

I need to get the response from API in `$response` and then store it in DB... How can I do this? :/

Answer: 
Use this as reference . I have successfully made curl GET request with this code

```
public function sendSms($mobile)
{
  $message ='Your message';
  $url = 'www.your-domain.com/api.php?to='.$mobile.'&text='.$message;

     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, $url);
     curl_setopt($ch, CURLOPT_POST, 0);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

     $response = curl_exec ($ch);
     $err = curl_error($ch);  //if you need
     curl_close ($ch);
     return $response;
}

```
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'],
            ]);

```