【问题标题】:curl POST not giving me resultcurl POST没有给我结果
【发布时间】:2020-02-16 10:58:39
【问题描述】:

我正在尝试对 json-rpc 进行 curl POST 请求,但是当我使用它时它没有给我任何错误,而且我不确定我做错了什么。一个小时一直想弄清楚怎么做

我正在尝试执行的请求:

http post https://rpc.nearprotocol.com jsonrpc=2.0 
method=query params:='["account/near.test", ""]' id=dontcare

我试过了:

curl -X POST https://rpc.nearprotocol.com -d 
'{"jsonrpc":"2.0","id":"0","method":"query", 
"account/near.test”:”snailbail45"}' -H 'Content-Type: application/json'```

但是它只是返回下一行。

这对我有用:

curl -X POST https://rpc.nearprotocol.com -d    
'{"jsonrpc":"2.0","id":"0","method":"status"}' -H 'Content-Type:     
application/json'

我在第一个中做错了什么?

【问题讨论】:

    标签: json curl post rpc


    【解决方案1】:

    您在testsnailbail45 之间使用了风格化引号( 而不是"):

    "account/near.test”:”snailbail45"
    

    【讨论】:

    • 好收获哈哈
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-05
    • 1970-01-01
    • 2011-10-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多