我试图将一个cURL命令导入Postman,但它说我有一个缺少的参数,但是当我在命令行运行它时,cURL命令有效,这里是cURL命令:
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
}
}
]
}'
Run Code Online (Sandbox Code Playgroud)
错误看起来像:
知道cURL命令有什么问题吗?就像我说的那样,当我在命令行运行它时.
也许你可以帮我把cURL命令翻译成HTTP,我假设它是一个HTTP GET,但我不知道除了以某种形式传递数据之外-d标志正在做什么.
小智 8
你的curl命令需要-X
和之间的空格GET
有关curl vs的更多信息,请参阅curl -GET和-X GETcurl GET
curl -X GET
编辑:看起来这只是邮递员的事,很奇怪.可能是Bug?
我能够使用以下功能将您的请求成功导入邮递员:
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}}]}'
Run Code Online (Sandbox Code Playgroud)