Sorry this could be a basic question as I'm getting started.
I'm performing a simple match all type query via Kibana which just works fine.
Then I just did "Copy as cURL" from kibana which looks likes this -
curl -XGET "http://localhost:9200/car/default/_search" -H 'Content-Type: application/json' -d'
{"query": {"match_all": {}}}'
and paste it as-is onto my Windows - Powershell but see this error -
PS C:\Users\aravind> curl -XGET "http://localhost:9200/car/default/_search" -H 'Content-Type: applica
tion/json' -d'
{"error":{"root_cause":[{"type":"json_parse_exception","reason":"Unexpected character (''' (code 39)): expected a valid
value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: org.elasticsearch.transport.netty4.ByteBu
fStreamInput@40fb2941; line: 1, column: 2]"}],"type":"json_parse_exception","reason":"Unexpected character (''' (code 39
)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: org.elasticsearch.tr
ansport.netty4.ByteBufStreamInput@40fb2941; line: 1, column: 2]"},"status":500}PS C:\Users\aravind> {"query": {"ma
tch_all": {}}}'
Unexpected token ':' in expression or statement.
At line:1 char:10
"+ {"query": <<<< {"match_all": {}}}'
+ CategoryInfo : ParserError: (::String) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken"
Now when I formatted the cURL like below (provided space between -d and single quote and then also moved the search query portion into first line essentially making the entire command into single line)
curl -XGET "http://localhost:9200/car/default/_search" -H 'Content-Type: applica
tion/json' -d '{"query": {"match_all": {}}}'
but I get this error -
{"error":{"root_cause":[{"type":"json_parse_exception","reason":"Unexpected character ('q' (code 113)): was expecting do
uble-quote to start field name\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@54a03843; line: 1, co
lumn: 3]"}],"type":"json_parse_exception","reason":"Unexpected character ('q' (code 113)): was expecting double-quote to
start field name\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@54a03843; line: 1, column: 3]"},"s
tatus":500}PS C:\Users\aravind>
What am I missing ?