The following cURL command is working:
curl -XPOST http://localhost:9200/test/test -d '{"name":"John", "age":31}' -H 'Content-Type: application/json'
However, when I execute the following command:
curl -XPOST http://localhost:9200/test/test -d '/mnt/c/path/to/filename/test.json' -H 'Content-Type: application/json'
I receive the following error:
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"failed to parse"}],"type":"mapper_parsing_exception","reason":"failed to parse","caused_by":{"type":"not_x_content_exception","reason":"Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"}},"status":400}
This is kind of weird since the content of this 'test.json' is exactly the same as in the first command. Namely: A compressed version of: '{"name":"John", "age":31}'.