Handle query parameters passed to an HTTP endpoint

Problem

You want to access the query parameters passed to an HTTP endpoint, such as:

http://example.com/hello-query?name=Nick

Solution

Use the msg.req.query property of the message sent by the HTTP In node to access the parameters.

Example

Discussion

The msg.req.query property is an object of key/value pairs for each query parameter.

In the above example, a request to /hello-query?name=Nick&colour=blue results in the property containing:

If there are multiple query parameters with the same name, they will be provided as an array. For example, /hello-query?colour=blue&colour=red:

Last updated

Was this helpful?