Cannot use curl to send JSON-RPC commands #1504

issue gavinandresen opened this issue on June 22, 2012
  1. gavinandresen commented at 6:34 PM on June 22, 2012: contributor

    The example of using curl to talk to bitcoind on the wiki works with 0.6.3, does not work with git HEAD:

     curl --user user --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getinfo", "params": [] }'  -H 'content-type: text/plain;' http://127.0.0.1:8332/
    

    git head gives: curl: (52) Empty reply from server

  2. gavinandresen closed this on Jun 22, 2012

  3. gavinandresen commented at 10:29 PM on June 22, 2012: contributor

    rpcssl=1 was set in the bitcoin.conf, so bitcoind was expecting a https connection.

  4. samosudov commented at 11:12 AM on December 23, 2017: none

    From #10218 (comment)

    Authentication is not optional. Configuring it yourself is optional, but bitcoind never accepts RPC connections without explicitly or implicitly configured username/password.

    If you didn't add user and pass in bitcoin.conf, you can use default from file /root/.bitcoin/.cache. For example: curl --user __cookie__:96fea535b009e62ddffe1c6f5090c50396d17e7f96d0b0a75eb580bdd1771d29 --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getinfo","params":[]}' -H 'content-type:text/plain;' http://127.0.0.1:8332

  5. lateminer referenced this in commit f110927139 on Jan 22, 2019
  6. lateminer referenced this in commit 4689f7e9a6 on May 6, 2020
  7. MarcoFalke locked this on Sep 8, 2021
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-02 15:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me