Take the tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am trying to post some xml data using curl on command line. Particularly I m trying to run the following command to connect to a billing service provider:

curl https://core.spreedly.com/v1/gateways.xml \
    -u 'secretKey' \
    -H 'Content-Type: application/xml' \
    -d '<gateway><gateway_type>test</gateway_type></gateway>'

However I m keep getting the following error:

< was unexpected at this time.

How should I type my xml data?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Redirection symbols can be escaped by placing those within double quotes ".

Instead of saying

'<gateway><gateway_type>test</gateway_type></gateway>'

you need to say

"<gateway><gateway_type>test</gateway_type></gateway>"
share|improve this answer
 
Thnx. It worked!!! –  panipsilos Jun 14 at 13:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.