I am trying to import a cURL command into Postman, but it says I have a missing argument, but the cURL command works when I run it at the command line, here is the cURL command:
curl -XGET 'http://scpt-wc-ap.sys.bombast.net:9200/_all/_search?pretty' -d '{
"query": {
"filtered": {
"query": {
"bool": {
"should": [
{
"query_string": {
"query": "source:smart_connect"
}
}
]
}
},
"filter": {
"bool": {
"must": [
{
"range": {
"@timestamp": {
"from": 1439899750653,
"to": 1439903350653
}
}
}
]
}
}
}
},
"highlight": {
"fields": {},
"fragment_size": 2147483647,
"pre_tags": [
"@start-highlight@"
],
"post_tags": [
"@end-highlight@"
]
},
"size": 500,
"sort": [
{
"_score": {
"order": "desc",
"ignore_unmapped": true
}
}
]
}'
the error looks like:
any idea what is wrong the cURL command? Like I said it works when I run it at the command line.
Perhaps you can just help me translate the cURL command into HTTP, I assume it's an HTTP GET, but I don't know what the -d flag is doing besides passing data in some form.
Your curl command needs a space between -X
and GET
see curl -GET and -X GET for more information about curl curl GET
vs curl -X GET
Edit: It looks like this is just a postman thing, weird. Bug Maybe?
I was able to successfully import your request into postman using this:
curl -X GET 'http://scpt-wc-ap.sys.bombast.net:9200/_all/_search?pretty' -d '{"query":{"filtered":{"query":{"bool":{"should":[{"query_string":{"query":"source:smart_connect"}}]}},"filter":{"bool":{"must":[{"range":{"@timestamp":{"from":1439899750653,"to":1439903350653}}}]}}}},"highlight":{"fields":{},"fragment_size":2147483647,"pre_tags":["@start-highlight@"],"post_tags":["@end-highlight@"]},"size":500,"sort":[{"_score":{"order":"desc","ignore_unmapped":true}}]}'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With