Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mattalhonte/e126b50024f0735f3f3e239d5b354dd9 to your computer and use it in GitHub Desktop.
Save mattalhonte/e126b50024f0735f3f3e239d5b354dd9 to your computer and use it in GitHub Desktop.
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \
> > "$class": "org.example.mynetwork.Commodity", \
> > "tradingSymbol": "54234", \
> > "description": "324234", \
> > "mainExchange": "string", \
> > "quantity": 523434, \
> > "maxVolts": 435324, \
> > "owner": "234324" \
> > }' 'http://composer.tanktwo.cloud:3000/api/Commodity'
{"error":{"statusCode":400,"name":"SyntaxError","message":"Unexpected token \\ in JSON at position 2","body":"{ \\\n> \"$class\": \"org.example.mynetwork.Commodity\", \\\n> \"tradingSymbol\": \"54234\", \\\n> \"description\": \"324234\", \\\n> \"mainExchange\": \"string\", \\\n> \"quantity\": 523434, \\\n> \"maxVolts\": 435324, \\\n> \"owner\": \"234324\" \\\n> }","status":400,"stack":"SyntaxError: Unexpected token \\ in JSON at position 2\n at Object.parse (native)\n at parse (/home/ubuntu/fabric-app/my-app/node_modules/body-parser/lib/types/json.js:88:17)\n at /home/ubuntu/fabric-app/my-app/node_modules/body-parser/lib/read.js:116:18\n at invokeCallback (/home/ubuntu/fabric-app/my-app/node_modules/raw-body/index.js:262:16)\n at done (/home/ubuntu/fabric-app/my-app/node_modules/raw-body/index.js:251:7)\n at IncomingMessage.onEnd (/home/ubuntu/fabric-app/my-app/node_modules/raw-body/index.js:307:7)\n at emitNone (events.js:86:13)\n at IncomingMessage.emit (events.js:185:7)\n at endReadableNT (_stream_readable.js:974:12)\n at _combinedTickCallback (internal/process/next_tick.js:80:11)\n at process._tickCallback (internal/process/next_tick.js:104:9)"}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment