Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: Atae on November 17, 2017, 12:00:06 AM



Title: curl returns empty output when json-rpc
Post by: Atae on November 17, 2017, 12:00:06 AM
I am not able to get JSON-RPC response via curl. It seems like is not accepting requests.

My bitcoin.conf
Code:
rpcuser=User123
rpcpassword=456Password
masternode=1
server=1
rpcport=9920
rpcconnect=127.0.0.1


Testing curl

Code:
curl  http://User123:456Password@127.0.0.1:9920/
JSONRPC server handles only POST requests

The output is always empty, doesn't matter if I add data or user,password. Is always empty:

Code:
C:\Users\admin\Desktop\BatchForLineNotify\Batch>curl http://User123:456Password@127.0.0.1:9920 -H 'content-type:text/plain;' --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getinfo","params":[]}'

C:\Users\admin\Desktop\BatchForLineNotify\Batch>

C:\Users\admin\Desktop\BatchForLineNotify\Batch>curl --user User123:456Password http://localhost:9920 -H 'content-type:text/plain;' --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getinfo","params":[]}'

C:\Users\admin\Desktop\BatchForLineNotify\Batch>

C:\Users\admin\Desktop\BatchForLineNotify\Batch>curl --user User123:456Password --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9920
curl: (6) Could not resolve host: 1.0,
curl: (3) Illegal port number
curl: (6) Could not resolve host: method
curl: (6) Could not resolve host: getinfo,
curl: (6) Could not resolve host: params
curl: (3) [globbing] bad range specification in column 2
curl: (3) [globbing] unmatched close brace/bracket in column 1
curl: (6) Could not resolve host: text

C:\Users\admin\Desktop\BatchForLineNotify\Batch>

Any ideas why is this happening? Don't know what else to try.