curl -> node, how to?
<p>I need to set the password for Neo4j and can do it from the command line like this:</p>

<pre><code>curl -H "Content-Type: application/json" \
   -H "Authorization: Basic `echo -n 'neo4j:neo4j' | base64`" \
   -X POST -d '{"password":"nopass"}' \
   http://localhost:7474/user/neo4j/password
</code></pre>

<p>but I'm now trying to do it in node.js like this:</p>

<pre><code>var f = require('node-fetch');
var url = 'http://neo4j:n0p4ss@localhost:7474/user/neo4j/password';
var auth = new Buffer('neo4j:neo4j').toString('base64');
f(url, {
    method: 'POST',
    body: {'password': 'nopass'},
    headers: {
        'Content-Type': 'application/json',
        'Authorization': 'Basic ' + auth
    }   
})
.then(res =&gt; res.text())
.then(txt =&gt; { console.log(txt); });
</code></pre>

<p>however, what I get back is:</p>

<pre><code>{
  "errors" : [ {
    "code" : "Neo.ClientError.Request.InvalidFormat",
    "message" : "Required parameter 'password' is missing."
  } ]
}
</code></pre>

<p>which to me means the <code>body: {...}</code> isn't getting sent correctly.  can anyone see what's wrong with my code?</p>