<p>Three things to check : </p>

<ul>
<li>Is there rpcssl=1 in your bitcoin.conf ? If so, set it to 0 or make HTTPS connections only</li>
<li>Have you set rpcallowip=127.0.0.1 ?</li>
<li>Try connect to http: //yourname:yourpassword@127.0.0.1:8332/ directly</li>
</ul>

<p>And the fourth thing to check (as I saw your answer) :</p>

<ul>
<li>Check if you have correctly entered your username and password ;)</li>
</ul>

CC BY-SA 3.0
2014-01-23T14:57:50.210Z
Please see my answer.  I tried entering http://yourname:yourpassword@127.0.0.1:8332/ into my browser and got {"result":null,"error":{"code":-32700,"message":"Parse error"},"id":null}.  How can I get this to work?
JLP
CC BY-SA 3.0
2014-01-23T15:20:39.567Z
Just edited my answer so ;) Indeed rcpallowip and rcpssl are not required but they can help you configure correctly your install
Nontenda
CC BY-SA 3.0
2014-01-23T08:35:59.120Z
2014-01-23T15:19:38.403Z
2014-01-23T15:19:38.403Z
Nontenda
<p>I had screwed up.  I entered the wrong yourname in </p>

<pre><code>curl --user yourname --data-binary '{"id":"t0", "method": "getinfo", "params": [] }' http://127.0.0.1:8332/
</code></pre>

<p>as what I had entered for rpcuser= in my bitcoin.conf file.</p>

<p>When I entered the right yourname, the curl command responded with correct data from my bitcoin wallet.</p>

<p>I had tried entering the following into bitcoin.conf file but they were unnecessary and so I removed them:</p>

<pre><code>rpcallowip=*
rpcallowip=127.0.0.1
rpcssl=1
</code></pre>

CC BY-SA 3.0
2014-01-23T14:57:27.427Z
2014-01-23T14:57:27.427Z
JLP
<p>I followed gavinadresen's answer at <a href="https://bitcoin.stackexchange.com/questions/2570/bitcoin-qt-command-line-control-on-mac">Bitcoin-Qt command line control on Mac</a>. When I enter the following in terminal, it works:</p>

<pre><code>open Bitcoin-Qt.app --args -server
</code></pre>

<p>I've put in the following into my bitcoin.conf file:</p>

<pre><code>rpcuser=yourname
rpcpassword=password
</code></pre>

<p>I entered the following in terminal:</p>

<pre><code>curl --user yourname --data-binary '{"id":"t0", "method": "getinfo", "params": [] }' http://127.0.0.1:8332/
</code></pre>

<p>The above prompts me for the password and then it shows the following:</p>

<pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"&gt;
&lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;Error&lt;/TITLE&gt;
&lt;META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=ISO-8859-1'&gt;
&lt;/HEAD&gt;
&lt;BODY&gt;&lt;H1&gt;401 Unauthorized.&lt;/H1&gt;&lt;/BODY&gt;
&lt;/HTML&gt;
</code></pre>

<p>The above output doesn't look right.  Aren't I supposed to get data from Bitcoin?  How do I get the curl command to work?</p>

CC BY-SA 3.0
2014-01-23T08:32:53.663Z
Can you check if rpcssl=1 is set in the bitcoin.conf ? If so, bitcoin is excepting only HTTPS connections.
Nontenda
<bitcoin-core><mac>
cURL to Bitcoin-Qt on Mac fails
JLP
# cURL to Bitcoin-Qt on Mac fails

(Asked by: username_0 on 2014-01-23)

I followed gavinadresen's answer at Bitcoin-Qt command line control on Mac. When I enter the following in terminal, it works:
open Bitcoin-Qt.app --args -server

I've put in the following into my bitcoin.conf file:
rpcuser=yourname
rpcpassword=password

I entered the following in terminal:
curl --user yourname --data-binary '{"id":"t0", "method": "getinfo", "params": [] }' http://127.0.0.1:8332/

The above prompts me for the password and then it shows the following:



Error


401 Unauthorized.


The above output doesn't look right.  Aren't I supposed to get data from Bitcoin?  How do I get the curl command to work?

**Tags:** bitcoin-core, mac

> **Comments:**
> **username_1**: Can you check if rpcssl=1 is set in the bitcoin.conf ? If so, bitcoin is excepting only HTTPS connections.  

---

## 2 answers

### Answer by username_1 on 2014-01-23. Score: 0 | Accepted answer

Three things to check :

* Is there rpcssl=1 in your bitcoin.conf ? If so, set it to 0 or make HTTPS connections only
* Have you set rpcallowip=127.0.0.1 ?
* Try connect to http: //yourname:yourpassword@127.0.0.1:8332/ directly

And the fourth thing to check (as I saw your answer) :

* Check if you have correctly entered your username and password ;)

> **Comments:**
> **username_0**: Please see my answer.  I tried entering http://yourname:yourpassword@127.0.0.1:8332/ into my browser and got {"result":null,"error":{"code":-32700,"message":"Parse error"},"id":null}.  How can I get this to work?  
> **username_1**: Just edited my answer so ;) Indeed rcpallowip and rcpssl are not required but they can help you configure correctly your install  

---

### Answer by username_0 on 2014-01-23. Score: 0

I had screwed up.  I entered the wrong yourname in 
curl --user yourname --data-binary '{"id":"t0", "method": "getinfo", "params": [] }' http://127.0.0.1:8332/

as what I had entered for rpcuser= in my bitcoin.conf file.
When I entered the right yourname, the curl command responded with correct data from my bitcoin wallet.
I had tried entering the following into bitcoin.conf file but they were unnecessary and so I removed them:
rpcallowip=*
rpcallowip=127.0.0.1
rpcssl=1


---

