curl on command prompt giving could not resolve localhost
<p>I am trying to run some elastic commands through curl.</p>
<p>On command prompt, when I type:</p>
<ul>
<li><code>curl www.google.com</code>: it works fine</li>
<li><code>curl localhost:9200</code>: elastic search hosted here, works fine</li>
</ul>
<p>But, the command:</p>
<pre><code>curl -XPOST 'localhost:9200/bank/account/_bulk?pretty' --data-binary &quot;@accounts.json&quot;`
</code></pre>
<p>Gives me error: <code>Could not resolve host: 'localhost</code></p>
<p>Below is snapshot.<a href="https://i.stack.imgur.com/IIdEv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IIdEv.png" alt="error in window cmd" /></a></p>
<p>Can someone suggest me how to correct this? Or if somehow I can use postman or some other http client to run this command?</p>