Derek
Derek

Reputation: 11915

How to authenticate to webservice with curl?

I am trying to get curl to run a webservice for a site I am working with. The site requires a login. I tried using --user:password with curl, but to no avail. How do I find out how to authenticate with the site?

Upvotes: 1

Views: 690

Answers (1)

jtabak
jtabak

Reputation: 122

This will probably take some trial and error with regards to what http-headers you need. When I had to do something similar with curl, I ended up doing multiple curl calls. First one would log into the site and store a cookie. Second call would use the cookie and do the real business.

Here's an example: http://curl.haxx.se/libcurl/php/examples/ebay_login.html

Upvotes: 2

Related Questions