views:

39

answers:

1

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?

+2  A: 

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

jtabak