【发布时间】:2019-06-07 19:38:03
【问题描述】:
就像this elastic get query 我看到下面的例子,根据我的理解,query_string 在GET request 的请求正文下传递。不是吗?但是我相信我们不能用 GET 请求传递请求体,那么这个例子怎么会是真的呢?
GET /_search
{
"query": {
"query_string" : {
"default_field" : "content",
"query" : "this AND that OR thus"
}
}
}
事实上,当我使用上述链接中的选项 COPY as CURL 时,我在下面看到复制文本
curl -X GET "localhost:9200/_search" -H 'Content-Type: application/json' -d'
{
"query": {
"query_string" : {
"default_field" : "content",
"query" : "this AND that OR thus"
}
}
}
'
我在这里遗漏了什么或示例中有什么问题吗?实际上我没有看到在Postman工具下发送请求正文的方式。
【问题讨论】:
-
这个答案可能会有所帮助:stackoverflow.com/a/34796014/4604579(提示:使用 Postman 时更改为 POST)
标签: elasticsearch web-applications http-post http-get