Accessing query string parameters
Cookies can be read using the following syntax: req.http.Cookie:user_id
.
Is there anything similar for query string parameters (e.g. req.url.qs:user_id
)?
So far I’ve been extracting values with a regex, but it would be great to have a helper like the one above.
-
I'll be the first to admit that it's nowhere near as nice, but it's closer:
set req.http.value-of-foo = subfield(req.url.qs, "foo", "&");
See here for more on this.
Please sign in to leave a comment.
Comments
4 comments