0

I am using fiddler 4 as a frond-end service for elasticsearch.

I'm trying to store a document into index using API following this.

Here's my sample json as request body:

{
    "fruit": "Apple",
    "size": "Large",
    "color": "Red"
}

API : http://localhost:9200/food/fruit method :POST HTTP/1.1

Here's the response:

enter image description here

Azima
  • 3,835
  • 15
  • 49
  • 95

1 Answers1

0

As mentioned in their doc., "Starting from Elasticsearch 6.0, all REST requests that include a body must also provide the correct content-type for that body." adding content-type: application/json in the request solved the issue.

enter image description here

Robert
  • 39,162
  • 17
  • 99
  • 152
Azima
  • 3,835
  • 15
  • 49
  • 95