I tried with content-type. I am still getting error for both cases (with single quotes & with double quotes). I am missing some information for sure.
Case 1(With single quotes)
curl -XPUT 'http://localhost:9200/products/mobiles/1' -H 'Content-Type: application/json' -d "{"name": "iPhone7", "camera": "12MP", "storage": "256GB", "display": "4.7inch", "battery": "1,960mAh", "reviews": ["Incredibly happy after having used it for one week", "Best iPhone so far", "Very expensive, stick to Android"]}"
curl: (1) Protocol "'http" not supported or disabled in libcurl
curl: (6) Could not resolve host: application
curl: (3) [globbing] bad range specification in column 106
Case 2 (With double quotes, with escape sequence)
curl -XPUT "http://localhost:9200/products/mobiles/1" -H "Content-Type: application/json" -d "{"name": "iPhone7", "camera": "12MP", "storage": "256GB", "display": "4.7inch", "battery": "1,960mAh", "reviews": ["Incredibly happy after having used it for one week", "Best iPhone so far", "Very expensive, stick to Android"]}"
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"failed to parse"}],"type":"mapper_parsing_exception","reason":"failed to parse","caused_by":{"type":"json_e_o_f_exception","reason":"Unexpected end-of-input in field name\n at [Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper@33fb2031; line: 1, column: 15]"}},"status":400}curl: (3) [globbing] bad range specification in column 106
Case 3 (With double quotes without " \ " - backslash escape sequence)
curl -XPUT "http://localhost:9200/products/mobiles/1" -H "Content-Type: application/json" -d "{"name": "iPhone7","camera": "12MP","storage": "256GB","display": "4.7inch","battery": "1,960mAh","reviews": ["Increadibly happy after having used it for one week", "Best iPhone so far", "Very expensive, stick to Android"] }"
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"failed to parse"}],"type":"mapper_parsing_exception","reason":"failed to parse","caused_by":{"type":"json_parse_exception","reason":"Unexpected character ('n' (code 110)): was expecting double-quote to start field name\n at [Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper@7d3f6505; line: 1, column: 3]"}},"status":400}curl: (6) Could not resolve host: happy
curl: (6) Could not resolve host: after
curl: (6) Could not resolve host: having
curl: (6) Could not resolve host: used
curl: (6) Could not resolve host: it
curl: (6) Could not resolve host: for
curl: (6) Could not resolve host: one
curl: (6) Could not resolve host: week, Best
curl: (6) Could not resolve host: iPhone
curl: (6) Could not resolve host: so
curl: (6) Could not resolve host: far, Very
curl: (6) Could not resolve host: expensive,
curl: (6) Could not resolve host: stick
curl: (6) Could not resolve host: to
curl: (3) [globbing] unmatched close brace/bracket in column 8
Thank you for the replies. It has been helpful. I am new to this so requesting guidance. Thanks again!