Skip to content

Instantly share code, notes, and snippets.

@bhowe
Last active May 26, 2018 12:27
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 bhowe/12b1d42fca17be4849f97101380af597 to your computer and use it in GitHub Desktop.
Save bhowe/12b1d42fca17be4849f97101380af597 to your computer and use it in GitHub Desktop.
This is a simple way to test CURL just copy to your webserver and run.
<?php
//Filename: curl_test.php
$ch = curl_init();
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//Uncomment this for Windows.
//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_URL, "EMBED YOUR FILE URL HERE ");
$result = curl_exec($ch);
echo '<pre>';
print_r(curl_getinfo($ch));
echo '</pre>';
echo 'Errors: ' . curl_errno($ch) . ' ' . curl_error($ch) . '<br><br>';
curl_close ($ch);
echo $result . 'EOF';
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment