A http connection requires a HTTP POST request with a custom header object Authentication-API-Key
With CURL it's automatically converted to [HTTP_AUTHENTICATION_API_KEY] => 12345 Cannot figure out why
A simplle extract from a php class for testing is
Please help me out, how to get a $_SERVER result with [Authentication-API-Key] => 123456
<?php
$contentType = 'text/xml';
$method = 'POST';
$auth = '';
$header1 = 'Authentication-API-Key: 12345';
$charset= 'ISO-8859-1';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://localhost/test/returnurl.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, Array('Content-type: ' .
$contentType . '; charset=' . $charset,
$header1));
curl_exec($ch);
?>
<?php
//http://localhost/test/returnurl.php
Print_r($_SERVER,true)
?>
output:
Array ( [HTTP_HOST] => localhost [HTTP_ACCEPT] => */* [CONTENT_TYPE] => text/xml; charset=ISO-8859-1 [HTTP_AUTHENTICATION_API_KEY] => 12345 ... )