When to use PUT versus POST?

It's all about REST semantics.

POST basically that you are posting a request which is going to modify the server state.

POST index/type
{
  "foo": "bar"
}

will generate an _id server side and will index the document with this _id.

PUT is used to send a resource to the server.

PUT index/type/id
{
  "foo": "bar"
}

will put or update a document named index/type/id in the server.

Makes sense?

More details here: https://en.wikipedia.org/wiki/Representational_state_transfer