1.2k questions
1.4k answers
361 comments
339 users
Yes, you can access a requests query string if the "Extract content as message (discard HTTP Headers and other MetaData)" is not checked on the "HTTP Configuration" tab of the "HTTP Listener". When it is not checked, you can access request metadata within your mapping and condition scripts and from a "Standard" condition node, etc.
To access the query string within your mapping scripts use the following code:
var queryString = source.getNode('/Request/QueryString');
In the above code, if the request was:
"http://host/something/labs?fileName=patient101record.pdf&createdDate=04302024&lastModifiedDate=04302024"
the queryString variable would be set to:
"fileName=patient101record.pdf&createdDate=04302024&lastModifiedDate=04302024"
To parse out and access the individual values by name from the queryString see the published function provided in this KB:
How to extract the Query Parameters from HTTP call? - Knowledge Base - Qvera
To URL decode values see this KB:
How do I unescape %40 from a queryString?
See also:
How can I get the request URI from the request of an HTTP Listener?
Handling HTTP requests and responses
Processing Requests in mapping nodes via HTTP Listener source node