I am running the following command in Windows prompt:
curl -XPUT http://127.0.0.1:9200/test-index/test-type/_mapping?pretty=true -d \'{\"test-type\": {\"prop
Windows's cmd
doesn't support strings with single quotes. Use "
and escape the inner ones with \"
.
"I searched for solutions and found alternatives such as put json data in files, but I cannot use it for some reasons"
This should work, with hello.json
in temp. The @
is requried.
c:\temp>curl -v -X PUT \
--data "@hello.json" \
-H "Content-Type:application/json" \
http://localhost:8080/api/myresource