如何在Windows 7中使用cmd使用cURL发布XML数据?

pan*_*los 4 xml curl cmd

我试图在命令行上使用curl发布一些xml数据.特别是我试图运行以下命令来连接到计费服务提供商:

curl https://core.spreedly.com/v1/gateways.xml \
    -u 'secretKey' \
    -H 'Content-Type: application/xml' \
    -d '<gateway><gateway_type>test</gateway_type></gateway>'
Run Code Online (Sandbox Code Playgroud)

但是我不断收到以下错误:

< was unexpected at this time.
Run Code Online (Sandbox Code Playgroud)

我该如何输入我的xml数据?

dev*_*ull 6

重定向符号可以通过将它们放在双引号内来转义".

而不是说

'<gateway><gateway_type>test</gateway_type></gateway>'
Run Code Online (Sandbox Code Playgroud)

你需要说

"<gateway><gateway_type>test</gateway_type></gateway>"
Run Code Online (Sandbox Code Playgroud)