Victor
Victor

Reputation: 17107

Elastic Search curl command not recognised in Windows

I downloaded elastic search and ran the elasticsearch.bat on my windows laptop, but as soon as I try: curl http://localhost:9200 I get:

C:\Temp\elasticsearch-6.4.0\bin>curl http://localhost:9200/
'curl' is not recognized as an internal or external command,
operable program or batch file.

What did I miss? I am following setup instructions as per: https://www.elastic.co/downloads/elasticsearch

Also the 'Invok _restMethod' gives error on power shell:

PS C:\Temp\elasticsearch-6.4.0\bin> Invoke-RestMethod http://localhost:9200
**The term 'Invoke-RestMethod' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.**
At line:1 char:18
+ Invoke-RestMethod <<<<  http://localhost:9200
    + CategoryInfo          : ObjectNotFound: (Invoke-RestMethod:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Upvotes: 2

Views: 2272

Answers (2)

Pandiyan Cool
Pandiyan Cool

Reputation: 6585

curl is an separate exe to run, you can download it from the following link https://curl.haxx.se/download.html

Or

You can run the elasticsearch using the following command in command prompt

bin\elasticsearch.bat

Or

you can install elastic search as service using the following command

elasticsearch-service.bat install

ref

https://efficientuser.com/2016/11/01/installing-elasticsearch-5-0-as-service-on-windows/

Upvotes: 1

Leo Bartkus
Leo Bartkus

Reputation: 1945

You are on windows, so like the documentation says, use powershell and run this:

Invoke-RestMethod http://localhost:9200 

Upvotes: 0

Related Questions