Converting a JSON body into a REST URI -
can please advise how can convert json body rest uri ?
get api/_search { "age":"5", "aggs" : { "uniq_gender" : { "terms" : { "field" : "gender.keyword" } } } }
you may proceed 1 of 2 options:
use
postbodypost api/_search { "age":"5", "aggs" : { "uniq_gender" : { "terms" : { "field" : "gender.keyword" } } } }
it may seem hack, simple , frankly used. rest perspective may considered resource creation (filter rather seach might better word here).
- use query string
get.
something like:
get api/_search?age=5,field=gender.keyword the problem using query string may limited. in rfc there a code such case. example ie browser has such limit - see details.
generally speaking if there no technical problem, readability issue may appear - hard deal 1000+ symbols string.
Comments
Post a Comment