<?php
// Mock POST request to /api/login
$url = 'https://sawdabazar.test/api/login';
$data = [
    'email' => 'reseller@demo.com',
    'password' => '12345678'
];

$options = [
    'http' => [
        'header'  => "Content-Type: application/json\r\nAccept: application/json\r\n",
        'method'  => 'POST',
        'content' => json_encode($data),
        'ignore_errors' => true // Prevent PHP warning on non-200 responses
    ],
    'ssl' => [
        'verify_peer' => false,
        'verify_peer_name' => false
    ]
];

$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);
$status_line = $http_response_header[0];

echo "Response Status: " . $status_line . "\n";
echo "Response Body: \n" . substr($result, 0, 300) . "\n";
