<?php // Set up the request URL and headers $url = 'https://www.axxess.co.za/careers/dev-test'; $headers = array( 'Authorization: Basic ' . base64_encode('applicant:canCode') ); // Initialize a cURL session $ch = curl_init(); // Set the cURL options curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CAINFO, __DIR__ . '/cacert.pem'); // Set the request data $data = array( 'first_name' => 'John', 'last_name' => 'Doe', 'mobile_number' => '1234567890', 'email_address' => 'johndoe@example.com', ); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data)); // Execute the request and store the response $response = curl_exec($ch); // Check for errors if(curl_errno($ch)) { echo 'Error: ' . curl_error($ch); } // Close the cURL session curl_close($ch); // Output the response echo $response; ?>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)