在 Chrome Postman 中尝试了 运行 链码 REST 请求

Tried running chaincode REST request in Chrome Postman

在chrome邮递员中,我的方法是POST,url是localhost:5000/chaincode

然后我的参数,我做了批量编辑并插入了这组代码。

{
  "jsonrpc": "2.0",
  "method": "deploy",
  "params": {
    "type": 1,
    "chaincodeID":{
        "path":"github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02"
    },
    "ctorMsg": {
        "function":"init",
        "args":["a", "1000", "b", "2000"]
    }
  },
  "id": 1
}

但是,它返回给我这组错误,我不明白为什么。我做了我被告知的一切。

{
  "jsonrpc": "2.0",
  "error": {
    "code": -32600,
    "message": "Invalid request",
    "data": "Client must supply a payload for chaincode requests."
  },
  "id": null
}

有谁知道我哪里出错了?

解决方案:

我正在使用 Chrome Postman 来测试 API 调用。没想到参数应该都写在body段。因此,在 body 段中输入我的所有参数后,它就像魔术一样工作。