hyperledger的REST API中的解组错误?

时间:2016-08-23 16:15:59

标签: rest hyperledger

我将此请求发送给hyperledger的REST API:

$ curl -X POST --header "Content-Type: application/json" -d '{ "jsonrpc": "2.0", "method": "deploy", "params": { "type": 1, "chaincodeID":{ "path":"github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" }, "ctorMsg": { "args":["init", "a", "1000", "b", "2000"] } }, "id": 1 }' localhost:7050/chaincode

这是我收到的错误消息:

{"jsonrpc":"2.0","error":{"code":-32700,"message":"Parse error","data":"Error unmarshalling chaincode request payload: illegal base64 data at input byte 0"},"id":null}

然后我在rest_api.go中添加了调试日志来检查对等方收到的内容 enter image description here 得到这个日志:

16:03:46.323 [rest] ProcessChaincode -> DEBU 027 reqBody = { "jsonrpc": "2.0", "method": "deploy", "params": { "type": 1, "chaincodeID":{ "path":"github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" }, "ctorMsg": { "args":["init", "a", "1000", "b", "2000"] } }, "id": 1 }
16:03:46.331 [rest] ProcessChaincode -> ERRO 028 Error unmarshalling chaincode request payload: illegal base64 data at input byte 0

收到的消息似乎与“rpcRequest”,“ChaincodeSpec”和“ChaincodeInput”的定义相符,我不明白为什么它一直向我抛出解组错误... enter image description here enter image description here

0 个答案:

没有答案