Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
themeRDark
titleCurl command line basic authentication
curl -u apiKey:apiKeySecret https://sandboxsecure.gotobilling.com/resource

...

Code Block
languagephp
themeRDark
titlePHP curl basic authentication
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://sandboxsecure.gotobilling.com/resource');
curl_setopt($ch, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
$result=curl_exec ($ch);

...