RESTリクエストREST要求を呼び出すと、REST応答
POST host:port/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",
"result": {
"status": "OK",
"message": "52b0d803fc395b5e34d8d4a7cd69fb6aa00099b8fabed83504ac1c5d61a425aca5b3ad3bf96643ea4fdaac132c417c37b00f88fa800de7ece387d008a76d3586"
},
"id": 1
}
を扱う私は、要求と応答のこのセットを持っている、と彼らはインターフェイスポートが私はどのように5000であることを言及この残りの要求を呼び出し、応答結果を警告しますか?私はjqueryを試みたが、私はそれをすることができなかった。彼らは私にウィンドウエラーを促し続けた。
これは私が
$.post('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
}, function (serverResponse) {
alert(serverResponse);
//do what you want with server response
})
あなたが試した投稿を投稿してください。 –
@PaulAbbottが追加されました。 – Alvin