curl - looking to test some Rest APIs - what is the syntax to Post xml to a rest api with basic authentication?
views:
41answers:
1
A:
This works for me.
curl -i POST -u "user:password" -H "Content-Type: application/xml" -d "<Foo></Foo>" http://example.org/resource
Darrel Miller
2010-07-01 17:42:48
What if it is an HTTPS url? Is there a way to trust certificates?
moorecats
2010-07-01 19:05:00
@moorecats the --cert option allows you to do that.
Darrel Miller
2010-07-01 19:33:13
I exported a certificate from a url i was trying to hit and put that path in the command in this way - curl https://url.com --cert c:\cert.cer and I got this error now - curl: (58) unable to use client certificate (no key found or wrong pass phrase?) My knowledge of certificates are limited, I know I do not need to put in a passphrase when hitting the site via Chrome/Firefox etc, so what is it looking for?
moorecats
2010-07-01 21:18:47