Skip to content

Instantly share code, notes, and snippets.

@Neal
Created March 8, 2014 18:52
Show Gist options
  • Save Neal/9436985 to your computer and use it in GitHub Desktop.
Save Neal/9436985 to your computer and use it in GitHub Desktop.
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CONNECTTIMEOUT => 9,
CURLOPT_TIMEOUT => 6,
CURLOPT_VERBOSE => 0,
CURLOPT_URL => 'http://gs.apple.com/TSS/controller?action=2',
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $HTTP_RAW_POST_DATA,
CURLOPT_HTTPHEADER => array('Content-Type: text/xml; charset=utf8', 'Content-length: ' . strlen($HTTP_RAW_POST_DATA))
));
$http_result = curl_exec($curl);
$http_error = curl_error($curl);
$http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
header("HTTP/1.1 $http_code");
print $http_result;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment