Nope. But it's always easier to run all that from Kibana Dev Console.
Just paste this and click run:
POST /test/_doc
{
"foo": "bar"
}
BTW this is not related to the initial question so you should create a new thread as I will park this one as solved.