Use of wrong HTTP verb while creating elasticsearch index

Viewed 20

To create an index in the elasticsearch, we need to use the PUT verb, for example, the following command:

curl -X PUT "localhost:9200/test_index" -d '{"settings":{"number_of_shards":2, "number_of_replicas":2}}' --header 'Content-Type: application/json'

But according to RFC 2616, § 9.5, POST can be also used to create a resource.

Why POST is not suitable here or why did elasticsearch designer use PUT instead of POST?

1 Answers
Related