Skip to content

Commit

Permalink
Fixed broken example
Browse files Browse the repository at this point in the history
  • Loading branch information
stefangabos committed May 12, 2022
1 parent d7de8fb commit b6c27f1
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions examples/custom-headers.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@
// instantiate the Zebra_cURL class
$curl = new Zebra_cURL();

// since we are communicating over HTTPS, we load the CA bundle from the examples folder,
// so we don't get CURLE_SSL_CACERT response from cURL
// you can always update this bundle from https://curl.haxx.se/docs/caextract.html
$curl->ssl(true, 2, __DIR__ . '/cacert.pem');
// set custom HTTP headers
$curl->option(CURLOPT_HTTPHEADER, [
'accept: application/json',
'X-Token-Foo-Bar: ABC123' // Pass keys to APIs, for example
]);

$curl->get('https://postman-echo.com/get?foo=bar1', function() use (&$curl) {
echo "Call 1 finished.\n";
// $curl->get('https://postman-echo.com/get?foo=bar2', function () {
// echo "Call 2 finished.\n";
// });
});
echo '<pre>';
echo $curl->scrap('http://httpbin.org/get') . PHP_EOL;

0 comments on commit b6c27f1

Please sign in to comment.