# Curl command : localhost connection refused

**URL:** <https://discuss.elastic.co/t/curl-command-localhost-connection-refused/38462>\
**Category:** Elasticsearch\
**Created:** [January 6, 2016, 5:23am UTC](https://discuss.elastic.co/t/curl-command-localhost-connection-refused/38462 "2016-01-06T05:23:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dilip\_Dwivedi](https://avatars.discourse-cdn.com/v4/letter/d/c0e974/32.png) [@Dilip\_Dwivedi](https://discuss.elastic.co/u/Dilip_Dwivedi)\
**Post date:** [January 6, 2016, 5:23am UTC](https://discuss.elastic.co/t/curl-command-localhost-connection-refused/38462/1 "2016-01-06T05:23:17Z")

</div>

I am trying to health check using curl commands in 2 diff ways .I am getting connection refused in 2nd way.Please advise why it is not working for 2nd option.

dilip@ubuntu:~/Desktop/ELK2/e/bin$ curl [http://localhost:9200/\_cat/health?pretty](http://localhost:9200/_cat/health?pretty)  
1452057531 21:18:51 elasticsearch green 1 1 0 0 0 0 0 0

dilip@ubuntu:~/Desktop/ELK2/e/bin$ curl ‘localhost:9200/\_cat/health?v’  
curl: (7) Failed to connect to xn--localhost-499d port 9200: Connection refused

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 6, 2016, 5:36am UTC](https://discuss.elastic.co/t/curl-command-localhost-connection-refused/38462/2 "2016-01-06T05:36:21Z")

</div>

You already have asked this in [Curl: (7) Failed to connect to xn--localhost-499d port 9200: Connection refused](https://discuss.elastic.co/t/curl-7-failed-to-connect-to-xn-localhost-499d-port-9200-connection-refused/38253/12), please keep it to the one thread.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 6, 2016, 5:36am UTC](https://discuss.elastic.co/t/curl-command-localhost-connection-refused/38462/3 "2016-01-06T05:36:24Z")

</div>


