Routing based on request body parameter

We have requirement of routing to different upstreams based on request body parameter.

Ex: Request body


"test": "XXX",

"country": "UK"       ------> UK upstream service



"test": "XXX",​

"country": "US"         ------> US upstream service


Based on request parameter, say country we need to route the traffic to respective upstream.

Could you please anybody help ?

Kong supports route by header. Please use that feature.

Parse the body. If the body is too large, it will affect Kong performance.