Skip to content

Instantly share code, notes, and snippets.

@matthewfitz
Created July 29, 2011 22:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthewfitz/1114840 to your computer and use it in GitHub Desktop.
Save matthewfitz/1114840 to your computer and use it in GitHub Desktop.
<?php
$ch = curl_init("https://opensky.com/api/v1/json/heartbeat");
curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_NOBODY, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('X_OPENSKY_API_KEY: foobar'));
$head = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
print_r($head);
print_r("<hr />");
print_r($httpCode);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment