ElasticSearch POST with json search body vs GET with json in url

前端 未结 2 1963
孤城傲影
孤城傲影 2021-02-07 10:21

According to the ES documentation, those 2 search request should get the same results:

GET

http://localhost:9200/app/users/_search?source={\"query\": {         


        
2条回答
  •  我寻月下人不归
    2021-02-07 11:19

    You should URL encode your query in the first case:

    http://localhost:9200/app/users/_search?source=%7b%22query%22%3a+%7b%22term%22%3a+%7b%22email%22%3a%22foo%40gmail.com%22%7d%7d%7d
    

提交回复
热议问题