Coder Social home page Coder Social logo

Comments (5)

stefangabos avatar stefangabos commented on August 24, 2024 1
// set custom HTTP headers
$curl->option(CURLOPT_HTTPHEADER, [
    'Accept: application/json',
    'X-Token-Foo-Bar: ABC123'   // Pass keys to APIs, for example
]);

from zebra_curl.

guimatheus01 avatar guimatheus01 commented on August 24, 2024
// set custom HTTP headers
$curl->option(CURLOPT_HTTPHEADER, [
    'Accept: application/json',
    'X-Token-Foo-Bar: ABC123'   // Pass keys to APIs, for example
]);

Well, I found the problem. I am really using the one you gave me. But I checked the API parameters I'm using and the problem was with authentication. I was using http_authentication () as suggested in the documentation and it didn't work. Then try a direct connection and it looks like it worked using $ curl-> option (CURLOPT_USERPWD, 'username1: password1'); following the parameters here in the documentation for options. Thank you for your attention and congratulations for the work provided here

from zebra_curl.

stefangabos avatar stefangabos commented on August 24, 2024

It should've worked with http_authentication also as what that does is just setting CURLOPT_USERPWD
the only issue that i can think of is that maybe the 3rd parameter of http_authentication must be something different than the default CURLAUTH_ANY - maybe try it CURLAUTH_BASIC. see the docs

from zebra_curl.

guimatheus01 avatar guimatheus01 commented on August 24, 2024

It should've worked with http_authentication also as what that does is just setting CURLOPT_USERPWD
the only issue that i can think of is that maybe the 3rd parameter of http_authentication must be something different than the default CURLAUTH_ANY - maybe try it CURLAUTH_BASIC. see the docs

Well, with this parameter CURLAUTH_BASIC, it worked perfectly. I appreciate the support. Excellent tool, the caching system helped a lot in the response time of the application I'm using, it's just incredible.

from zebra_curl.

stefangabos avatar stefangabos commented on August 24, 2024

awesome, I'm glad you found it useful!

from zebra_curl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.