0
votes

I am trying to attach data json and tried to index the data into elastic search using postman client

{
    "error": "Content-Type header [text/plain;charset=UTF-8] is not supported",
    "status": 406
}

POST method - http://localhost:9200/product/default/_bulk?pretty

POST method - http://localhost:9200/product/default/_bulk?pretty

Json data in attachment like

{"index":{"_id":1}}
{"name":"Wine - Maipo Valle Cabernet","price":152,"in_stock":38,"sold":47,"tags":["Alcohol","Wine"],"description":"Aliquam augue quam, sollicitudin vitae, consectetuer eget, rutrum at, lorem. Integer tincidunt ante vel ipsum. Praesent blandit lacinia erat. Vestibulum sed magna at nunc commodo placerat. Praesent blandit. Nam nulla. Integer pede justo, lacinia eget, tincidunt eget, tempus vel, pede. Morbi porttitor lorem id ligula.","is_active":true,"created":"2004\/05\/13"}
{"index":{"_id":2}}
{"name":"Tart Shells - Savory","price":99,"in_stock":10,"sold":430,"tags":[],"description":"Pellentesque at nulla. Suspendisse potenti. Cras in purus eu magna vulputate luctus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vivamus vestibulum sagittis sapien. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Etiam vel augue. Vestibulum rutrum rutrum neque. Aenean auctor gravida sem.","is_active":true,"created":"2007\/10\/14"}

Response:

{
    "error": "Content-Type header [text/plain;charset=UTF-8] is not supported",
    "status": 406
}
1

1 Answers

1
votes

You need to change the content type of body to JSON enter image description here

Here is also gif showing how to change the content type of the request: enter image description here

Hope that helps.