# Getting started - where and how to use POST command example?

**URL:** <https://discuss.elastic.co/t/getting-started-where-and-how-to-use-post-command-example/216588>\
**Category:** Elasticsearch\
**Created:** [January 27, 2020, 12:59am UTC](https://discuss.elastic.co/t/getting-started-where-and-how-to-use-post-command-example/216588 "2020-01-27T00:59:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![debasisc](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@debasisc](https://discuss.elastic.co/u/debasisc)\
**Post date:** [January 27, 2020, 12:59am UTC](https://discuss.elastic.co/t/getting-started-where-and-how-to-use-post-command-example/216588/1 "2020-01-27T00:59:01Z")

</div>

Just recently installed Elasticsearch in Windows 10.  
Trying to follow "getting started" tutorial.

Can you provide working version of curl command or equivalent whereby I can execute this step?

I do not have Kibana installed yet.

Simple GET works from Windows CMD window.

```auto
C:\Users\debasisc>curl -X GET localhost:9200
{
  "name" : "CDDMLW008",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "ENU01Xf1T5-sZRyF-jF7Vw",
  "version" : {
    "number" : "7.5.2",
    "build_flavor" : "default",
    "build_type" : "zip",
    "build_hash" : "8bec50e1e0ad29dad5653712cf3bb580cd1afcdf",
    "build_date" : "2020-01-15T12:11:52.313576Z",
    "build_snapshot" : false,
    "lucene_version" : "8.3.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

```

Thank you

```auto
POST localhost:9200/accounts/person/1 
{
    "name" : "John",
    "lastname" : "Doe",
    "job_description" : "Systems administrator and Linux specialit"
}

```

Getting started shows example PUT - but looks like that is not supported.

I then tried to create separate file with input. And used POST. Even then I get error.

C:\Elasticsearch\elasticsearch-7.5.2\bin\>type try1.txt  
{  
"name": "John Doe"  
}  
C:\Elasticsearch\elasticsearch-7.5.2\bin\>curl -X POST -d try1.txt localhost:9200/accounts/person/1  
{"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}  
C:\Elasticsearch\elasticsearch-7.5.2\bin\>

---

<div class="post-metadata">

**Author:** ![debasisc](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@debasisc](https://discuss.elastic.co/u/debasisc)\
**Post date:** [January 27, 2020, 2:12am UTC](https://discuss.elastic.co/t/getting-started-where-and-how-to-use-post-command-example/216588/2 "2020-01-27T02:12:55Z")

</div>

Okay, after several tries - this command works -

My command is in separate file "try1.txt"  
C:\Elasticsearch\elasticsearch-7.5.2\bin\>type try1.txt

{

"name": "John Doe"

}

C:\Elasticsearch\elasticsearch-7.5.2\bin\>curl -X POST -d @try1.txt -H "Content-Type: application/json" localhost:9200/accounts/person/1

{"\_index":"accounts","\_type":"person","\_id":"1","\_version":1,"result":"created","\_shards":{"total":2,"successful":1,"failed":0},"\_seq\_no":0,"\_primary\_term":1}

---

<div class="post-metadata">

**Author:** ![HenningAndersen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/henningandersen/32/48188_2.png) [@HenningAndersen](https://discuss.elastic.co/u/HenningAndersen)\
**Post date:** [January 27, 2020, 12:53pm UTC](https://discuss.elastic.co/t/getting-started-where-and-how-to-use-post-command-example/216588/3 "2020-01-27T12:53:35Z")

</div>

Hi @debasisc,

glad that you found a solution. Notice that all examples in the elasticsearch docs have a "Copy as cURL" option, making it easy to go from the examples to pasting them into a terminal. See for instance [this example](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html#_create_document_ids_automatically).

---

<div class="post-metadata">

**Author:** ![debasisc](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@debasisc](https://discuss.elastic.co/u/debasisc)\
**Post date:** [January 27, 2020, 12:59pm UTC](https://discuss.elastic.co/t/getting-started-where-and-how-to-use-post-command-example/216588/4 "2020-01-27T12:59:14Z")

</div>

Thanks. Indeed the link "Copy as cURL" is very useful.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 24, 2020, 12:59pm UTC](https://discuss.elastic.co/t/getting-started-where-and-how-to-use-post-command-example/216588/5 "2020-02-24T12:59:14Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
