关于Windows 10问题的cURL

时间:2018-05-28 13:00:14

标签: curl windows-10

有人请帮帮我吗? 我安装了它并测试了coinbase的API,没关系

 F:\curl\bin>curl https://api.coinbase.com/v2/prices/spot?currency=USD
 {"data":{"base":"BTC","currency":"USD","amount":"7268.29"},"warnings": 
 [{"id":"missing_version","message":"Please supply API version (YYYY-MM-DD) 
 as CB-VERSION 
 header","url":"https://developers.coinbase.com/api#versioning"}]}

但是当在其他API上使用cURL时,不幸的是cURL很糟糕,例如,当我使用这些行的某个网站的API时:

curl -X POST \
--header "X-Backtory-Authentication-Id: 5b0baf0de4b0988b2cea3438" \
--header "X-Backtory-Authentication-Key: 5b0baf0de4b0f80a3dc1d30a" \
-F "username=divar" \
-F "password=123" \
https://api.backtory.com/auth/login

结果是:

 F:\curl\bin> curl -X POST \
 Invoke-WebRequest : A parameter cannot be found that matches parameter name 
 'X'.
At line:1 char:6
+ curl -X POST \
+      ~~
+ CategoryInfo          : InvalidArgument: (:) [Invoke-WebRequest], 
ParameterBindingException
+ FullyQualifiedErrorId : 
NamedParameterNotFound,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

PS F:\curl\bin>     --header "X-Backtory-Authentication-Id: 
5b0baf0de4b0988b2cea3438" \
At line:1 char:7
+     --header "X-Backtory-Authentication-Id: 5b0baf0de4b0988b2cea3438" ...
+       ~
Missing expression after unary operator '--'.
At line:1 char:7
+     --header "X-Backtory-Authentication-Id: 5b0baf0de4b0988b2cea3438" ...
+       ~~~~~~
Unexpected token 'header' in expression or statement.
+ CategoryInfo          : ParserError: (:) [], 
ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingExpressionAfterOperator

PS F:\curl\bin>     --header "X-Backtory-Authentication-Key: 
5b0baf0de4b0f80a3dc1d30a" \
At line:1 char:7
+     --header "X-Backtory-Authentication-Key: 5b0baf0de4b0f80a3dc1d30a ...
+       ~
Missing expression after unary operator '--'.
At line:1 char:7
+     --header "X-Backtory-Authentication-Key: 5b0baf0de4b0f80a3dc1d30a ...
+       ~~~~~~
Unexpected token 'header' in expression or statement.
+ CategoryInfo          : ParserError: (:) [], 
 ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingExpressionAfterOperator

PS F:\curl\bin>     -F "username=divar" \
 -F : The term '-F' is not recognized as the name of a cmdlet, function, 
 script file, or operable program. Check the
 spelling of the name, or if a path was included, verify that the path is 
 correct and try again.
 At line:1 char:5
 +     -F "username=divar" \
 +     ~~
+ CategoryInfo          : ObjectNotFound: (-F:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

PS F:\curl\bin>     -F "password=123" \
-F : The term '-F' is not recognized as the name of a cmdlet, function, 
script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is 
correct and try again.
At line:1 char:5
+     -F "password=123" \
+     ~~
+ CategoryInfo          : ObjectNotFound: (-F:String) [], 
CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

它有什么问题? 我使用其他地方的API,问题是相同的,它不会返回任何结果但是错误

0 个答案:

没有答案