1

I'm trying to post an XML to a REST API via CURL:

λ curl -X POST  -H "Content-Type: application/xml" http://localhost/vcardservice -d '<?xml version='1.0' encoding='ISO-8859-1' standalone='yes'?><ns2:vCardRequestStore>
    <vcardRequestList> <vcardRequest></vcardRequest></vcardRequestList></ns2:vCardRequestStore>'

but is not working

Error:
    < was unexpected at this time.

Any help is appreciated.

1
  • strange, this works for me as is on Ubuntu with curl 7.35.0. obviously I get a 404 page, but no error. So I'm guessing it's a problem with your vcardservice Commented Apr 14, 2016 at 14:04

1 Answer 1

1

Try with escaped double qoutes inside the data payload

<?xml version=\"1.0\" encoding=\"ISO-8859-1\" standalone=\"yes\"?> ...
Sign up to request clarification or add additional context in comments.

1 Comment

thanks, to fix I had to add double quotes instead of single quotes and escape the quotes in the backslash

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.