Skip to content

Instantly share code, notes, and snippets.

@thangman22
Created June 11, 2014 07:41
Show Gist options
  • Save thangman22/c36c6200090c52afb7e9 to your computer and use it in GitHub Desktop.
Save thangman22/c36c6200090c52afb7e9 to your computer and use it in GitHub Desktop.
curl-snipet
$url = 'http://www.website.com/file.json';
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, '{}');
$response = curl_exec($curl);
$resultStatus = curl_getinfo($curl);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment