400 Bad request

Your question may already have an answer on the community forum. Please search for related topics, and then read through the guidelines before creating a new topic.

I try to test GET and POST request on FlexSearch Server which eventually I have to create a search index on my web portal.
So I want to see if the server’s response both POST and GET,however,I get “400 Bad request” error every time.Moreover the error point out that “The request cannot be fulfilled due to bad syntax”.

The GET and POST requests are below:

The GET:

http://localhost:9800/indices/contact HTTP/1.1

THE POST

http://localhost:9800/indices HTTP/1.1

and body for the post:

Content-Type: application/json; charset=utf-8

{
  "indexName": "contact",
  "fields": [
    {
      "fieldName": "employeeid",
      "fieldType": "Keyword",
    },
    {
      "fieldName": "firstname"
    },
    {
      "fieldName": "lastname",
    },
    {
      "fieldName": "dob",
      "fieldType": "DateTime",
    }
  ]
}

Where do I make a mistake?
I would be appreciated to your response.