我正在尝试在命令行上使用 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>'
但是我不断收到以下错误:
< was unexpected at this time.
我应该如何输入我的 xml 数据?
最佳答案
重定向符号可以通过将它们放在双引号 "
中进行转义。
而不是说
'<gateway><gateway_type>test</gateway_type></gateway>'
你要说
"<gateway><gateway_type>test</gateway_type></gateway>"
关于xml - 如何在 Windows 7 中使用 cmd 使用 cURL 发布 XML 数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17106996/