How to get the value of a query parameter received by tRESTRequest


How do you configure a tRESTRequest component so that it can be called with the GET method with a query parameter, q=xxxxxxxxxx, in the URL, for example?

http://hostname : port/resource?q=xxxxxxxxxx



Configure the tRESTRequest component with a query parameter, by editing the schema, add a column (using any name), then set the Comment field to query.



Then you can get the value of this query, in this case "q", (for example, in a tJava or tJavaRow component), using the following code:


String q_value =

(String) ((Map<String, Map<String, List<String>>>)globalMap.get("restRequest")).get("ALL_QUERY_PARAMS").get("q").get(0);
Version history
Revision #:
3 of 3
Last update:
‎11-18-2019 07:02 AM
Updated by: