如果我要在没有--data "..."
,它工作得很好。我试过谷歌,但找不到这个问题的任何答案。按照位于的指示here https://guides.instructure.com/m/4214/l/83393-how-do-i-install-and-use-curl-on-a-windows-machine当我尝试使用 cURL 发布数据时,出现以下错误:
PS C:\Users\David> curl --data "SMethod=0" "http://localhost/terra/modules/scripts/Query.php"
Invoke-WebRequest : A positional parameter cannot be found that accepts argument 'SMethod=0'.
At line:1 char:1
+ curl --data "SMethod=0" "http://localhost/terra/modules/scripts/Query.php"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
您的问题在这里得到解答:在 64 位 Windows 上运行 cURL https://stackoverflow.com/questions/25044010/running-curl-on-64-bit-windows
您没有运行curl,而是运行名为Invoke-WebRequest 的东西,它的别名是curl。你需要 unalias 卷曲,download http://curl.haxx.se/download.html并安装curl(如果尚未安装)。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)