Skip to content

Instantly share code, notes, and snippets.

Created June 4, 2015 14:52
Show Gist options
  • Save anonymous/17618c9ace2e0dd15611 to your computer and use it in GitHub Desktop.
Save anonymous/17618c9ace2e0dd15611 to your computer and use it in GitHub Desktop.
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, $centralUrl );
curl_setopt( $ch, CURLOPT_FAILONERROR, 1 );
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1 );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_TIMEOUT, 3 );
curl_setopt( $ch, CURLOPT_POST, true );
curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC );
curl_setopt( $ch, CURLOPT_USERPWD, $authString );
curl_setopt( $ch, CURLOPT_POSTFIELDS, $postFields );
$result = curl_exec ($ch);
curl_close($ch);
echo $result;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment