// GET
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://yourwebsite.com/api/store/products");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$headers = [
'X-Api-Key: YOUR_API_KEY'
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$output = curl_exec ($ch);
curl_close ($ch);
// POST
curl_setopt($ch, CURLOPT_URL, "https://yourwebsite.com/api/auth/login");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
'username' => 'test',
'password' => 'test'
]);
$headers = [
'X-Api-Key: YOUR_API_KEY'
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$output = curl_exec ($ch);
curl_close ($ch);