Skip to content

Instantly share code, notes, and snippets.

@jondavidjohn
Forked from anonymous/gist:17618c9ace2e0dd15611
Last active August 29, 2015 14:22
Show Gist options
  • Save jondavidjohn/a3cc727e9b938674e19a to your computer and use it in GitHub Desktop.
Save jondavidjohn/a3cc727e9b938674e19a 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