How to host XML data with cURL using cmd in Windows 7?

I am trying to publish some xml data using curl on the command line. In particular, I am 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 keep getting the following error:

 < was unexpected at this time. 

How do I enter xml data?

+4
source share
1 answer

Redirection characters can be escaped by placing them in double quotation marks. "

Instead of talking

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

you need to say

 "<gateway><gateway_type>test</gateway_type></gateway>" 
+6
source

Source: https://habr.com/ru/post/1486215/


All Articles