我试图通过命令行将参数传递给cURL,这样:
curl -s -X POST -H "Content-Type: text/xml" -H "Cache-Control: no-cache" -d '<Data Token="someToken" Name='"$appName"' ID='"$someVar"' ParseAppID='"$someVar"' ParseRESTKey='"$someVar"' AndroidPackage='"$someVar"' Version="1"></Data>' 'https://prefix.something.com/somePath?InputType=Xml'
Run Code Online (Sandbox Code Playgroud)
(此行实际上是从Postman应用程序中提取的).
我用Google搜索了这个问题,发现了许多对我不起作用的解决方案(链接是过去的问题......):
'before...'"${someVar}"'...after...'.无法完成请求.-d @fileName).无法发布.<Data>双引号替换令牌周围的单引号 - 但命令显然不能接受这样的替换.我得到的错误是<Error></Error>或者The server encountered an error and could not complete your request.
有没有机会存在其他解决方案?以前有人遇到过这样的问题吗?
我会很乐意提供任何帮助.