Rest 服务器出错:HyperLedger

Error With Rest Server: HyperLedger

我正在按照这里的教程进行操作:

https://hyperledger.github.io/composer/tutorials/queries.html#step-six-test-the-rest-apis-and-create-some-data

当我尝试 post 数据时,

我收到以下回复:

{
  "error": {
    "statusCode": 400,
    "name": "SyntaxError",
    "message": "Unexpected token \n in JSON at position 38",
    "body": "{\n  \"$class\": \"org.acme.biznet.Trader,\n  \"tradeId\": \"TRADER1\",\n  \"firstName\": \"Jenny\",\n  \"lastName\": \"Jones\"\n}",
    "status": 400,
    "stack": "SyntaxError: Unexpected token \n in JSON at position 38\n    at JSON.parse (<anonymous>)\n    at parse (/usr/local/lib/node_modules/composer-rest-server/node_modules/body-parser/lib/types/json.js:88:17)\n    at /usr/local/lib/node_modules/composer-rest-server/node_modules/body-parser/lib/read.js:116:18\n    at invokeCallback (/usr/local/lib/node_modules/composer-rest-server/node_modules/raw-body/index.js:262:16)\n    at done (/usr/local/lib/node_modules/composer-rest-server/node_modules/raw-body/index.js:251:7)\n    at IncomingMessage.onEnd (/usr/local/lib/node_modules/composer-rest-server/node_modules/raw-body/index.js:307:7)\n    at emitNone (events.js:105:13)\n    at IncomingMessage.emit (events.js:207:7)\n    at endReadableNT (_stream_readable.js:1059:12)\n    at _combinedTickCallback (internal/process/next_tick.js:138:11)\n    at process._tickCallback (internal/process/next_tick.js:180:9)"
  }
}

对于这方面的任何指导,我将不胜感激,因为据我所知,我已逐字遵循文档。

看起来您只是在输入中遗漏了 org.acme.biznet.Trader 的右引号。