# XPOST Failing

**URL:** <https://discuss.elastic.co/t/xpost-failing/308153>\
**Category:** Elasticsearch\
**Created:** [June 25, 2022, 6:22am UTC](https://discuss.elastic.co/t/xpost-failing/308153 "2022-06-25T06:22:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![chandramouli\_ravi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chandramouli_ravi/32/107222_2.png) [@chandramouli\_ravi](https://discuss.elastic.co/u/chandramouli_ravi)\
**Post date:** [June 25, 2022, 6:22am UTC](https://discuss.elastic.co/t/xpost-failing/308153/1 "2022-06-25T06:22:47Z")

</div>

Hi,

I am running elasticsearch 8.2.3 from my laptop.

Able to check health, create index but insert document is failing.  
Could you please help what's the problem here.

C:\Users\ravich\>curl --insecure -H "Content-Type: application/json" -XPUT "[https://elastic:PASSWORD@172.20.192.1:9201/customer/external/1](https://elastic:PASSWORD@172.20.192.1:9201/customer/external/1)" -d "{ "name" : "chandra"}"  
{"error":"no handler found for uri [/customer/external/1] and method [PUT]"}

Thanks,  
Chandra

---

<div class="post-metadata">

**Author:** ![sudhagar\_ramesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sudhagar_ramesh/32/105673_2.png) [@sudhagar\_ramesh](https://discuss.elastic.co/u/sudhagar_ramesh)\
**Post date:** [June 25, 2022, 11:41am UTC](https://discuss.elastic.co/t/xpost-failing/308153/2 "2022-06-25T11:41:47Z")

</div>

Hello @chandramouli_ravi

By seeing the command , i could confirm that you are curling in windows.Try this command it will work for sure

`curl -XPUT "http://elastic:PASSWORD@localhost:9200/customer/_doc/1?pretty" -H "Content-Type: application/json" -d"{\"name\":\"Chandra\"}"`

Keep posted !!! Thanks !!!

PS: I would also request you to change the case title XPUT Failing as you are curling with PUT

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [June 25, 2022, 2:41pm UTC](https://discuss.elastic.co/t/xpost-failing/308153/3 "2022-06-25T14:41:12Z")

</div>

Hi @sudhagar_ramesh

Your base syntax is incorrect assuming you want to put this in the index name `customer`

I'm not sure where you got the `external` part of the curl where you have that should be `_doc` which is the type... Always the type other types were eliminated in 7.x

To PUT which means you can set the document ID.

`curl --insecure -H "Content-Type: application/json" -XPUT "https://elastic:PASSWORD@172.20.192.1:9201/customer/_doc/1" -d "{ "name" : "chandra"}"`

POST where it would create its own generated document ID.

`curl --insecure -H "Content-Type: application/json" -XPOST "https://elastic:PASSWORD@172.20.192.1:9201/customer/_doc" -d "{ "name" : "chandra"}"`

---

<div class="post-metadata">

**Author:** ![sudhagar\_ramesh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sudhagar_ramesh/32/105673_2.png) [@sudhagar\_ramesh](https://discuss.elastic.co/u/sudhagar_ramesh)\
**Post date:** [June 25, 2022, 2:47pm UTC](https://discuss.elastic.co/t/xpost-failing/308153/4 "2022-06-25T14:47:19Z")

</div>

Hello @stephenb

Thanks for your inputs.  
Thought the externals is used as doc type by user.

i have changed it now.

---

<div class="post-metadata">

**Author:** ![chandramouli\_ravi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chandramouli_ravi/32/107222_2.png) [@chandramouli\_ravi](https://discuss.elastic.co/u/chandramouli_ravi)\
**Post date:** [June 25, 2022, 2:48pm UTC](https://discuss.elastic.co/t/xpost-failing/308153/5 "2022-06-25T14:48:57Z")

</div>

Thank you @stephenb@sudhagar_ramesh  
I am able to run now

---

<div class="post-metadata">

**Author:** ![chandramouli\_ravi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chandramouli_ravi/32/107222_2.png) [@chandramouli\_ravi](https://discuss.elastic.co/u/chandramouli_ravi)\
**Post date:** [June 25, 2022, 2:50pm UTC](https://discuss.elastic.co/t/xpost-failing/308153/6 "2022-06-25T14:50:47Z")

</div>

For everyone's use, working command which is same as suggested.

curl --insecure -H "Content-Type: application/json" -XPUT "[https://elastic:password@172.20.192.1:9201/customer/\_doc/1](https://elastic:password@172.20.192.1:9201/customer/_doc/1)" -d "{"name" : "chandra"}"

---

<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:** [July 23, 2022, 2:51pm UTC](https://discuss.elastic.co/t/xpost-failing/308153/7 "2022-07-23T14:51:27Z")

</div>

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