According to the official documentation, but there are some differences under windows, it does not recognize single quotes ', so if you do this, you will get an error:
C:\users\neusoft>curl LOCALHOST:9200/B1/B2/1-d {"name": "Fdafa"}{"error": " Mapperparsingexceptionjsonparseexception[Unrecognized token ' Fdafa ': was expecting ' null ', ' true ', ' False '1, column:13]]; "," Status ": 400}
At this point, you need to add double quotes around {}, and double quotes inside the JSON are escaped
C:\users\neusoft>curl LOCALHOST:9200/B1/B2/1-d "{\" name\ ": \" Fdafa\ "}" {"_index": "B1", "_type": "B2", "_id": "1", "_version": 1, "created":True}
This is normal!
The same problem is encountered under Linux, and sometimes the JSON does not recognize the parameters, and it also needs to be escaped before it can be used.
Elasticsearch Insert data under Windows Error!