<?php
// Test existing user enroll
$url = 'http://localhost/smartthink/website/api/enroll.php';
$payload = [
    'course_id' => 1,
    'first_name' => 'Test',
    'last_name' => 'Student',
    'email' => 'student1@SmartThink.test',
];
$options = [
    'http' => [
        'header'  => "Content-type: application/json\r\n",
        'method'  => 'POST',
        'content' => json_encode($payload),
        'timeout' => 30
    ]
];
$context  = stream_context_create($options);
$result = @file_get_contents($url, false, $context);
if ($result === false) {
    echo "Request failed\n";
    var_dump($http_response_header);
} else {
    echo $result;
}
