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:

  1. use post body

    post 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).

  1. 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

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -