Ride-The-Lightning / c-lightning-REST

REST APIs for Core Lightning written with node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with parameters

AngeloMetal opened this issue · comments

I'm trying to execute genInvoice from LAN, but I don't quite understand what I'm doing wrong.

curl -X POST "https://192.168.2.5:3001/v1/invoice/genInvoice" -H  "accept: application/json" -H  "Content-Type: application/json" -H 'macaroon: AgEL[...]l4=' --insecure -d amount=1000 -d label="test1" -d description="test2"

Result:

SyntaxError: Unexpected token a in JSON at position 0
    at JSON.parse (<anonymous>)
    at createStrictSyntaxError (/home/bitcoin/c-lightning-REST/node_modules/body-parser/lib/types/json.js:158:10)
    at parse (/home/bitcoin/c-lightning-REST/node_modules/body-parser/lib/types/json.js:83:15)
    at /home/bitcoin/c-lightning-REST/node_modules/body-parser/lib/read.js:121:18
    at invokeCallback (/home/bitcoin/c-lightning-REST/node_modules/raw-body/index.js:224:16)
    at done (/home/bitcoin/c-lightning-REST/node_modules/raw-body/index.js:213:7)
    at IncomingMessage.onEnd (/home/bitcoin/c-lightning-REST/node_modules/raw-body/index.js:273:7)
    at IncomingMessage.emit (events.js:314:20)
    at endReadableNT (_stream_readable.js:1241:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

Is it the parameters? I'm confused from your main page (and from localhost:4001/api-docs); how am I suppose to insert the parameters?

BTW, I'm using c-lightning v0.10.2. I don't know how can I find out my c-lightning-REST's version.