【发布时间】:2019-07-28 20:50:29
【问题描述】:
所以我正在开发一个区块链项目,并且代码本身已被修复到不会给我错误的地方。它告诉我“在 xyz 上运行”
也就是说,当我像其他人之前提到的那样使用 PowerShell 并运行 Invoke-WebRequest(而不是 curl)时,我得到了错误:
PS C:\Users\sebt1> Invoke-WebRequest "localhost:5000/txion" \ -H "Content-Type:
application/json" \ -d '{"from": "akjflw", "to":"fjlakdj", "amount": 3}'
Invoke-WebRequest:无法绑定参数“标头”。无法转换 “System.String”类型的“Content-Type: application/json”值 输入
“System.Collections.IDictionary”。在行:1 字符:47 + ... "localhost:5000/txion" \ -H "Content-Type: application/json" \ -d '{ ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo: InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
【问题讨论】:
标签: windows powershell curl blockchain pycurl