Accessing query string parameters



  • Will Delves

    Agreed - this would be really useful!

    The existing URL parameter functions are good (removing, whitelisting etc) - but having a function to get a given parameter value would be great.

  • Justin

    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.

  • Alex G

    Thanks, Justin! Wasn't aware of the subfield function.

    What does the third argument of the subfield function do? Is it a separator char?

  • Justin

    Correct. That specifies the separator.

Please sign in to leave a comment.