Giter VIP home page Giter VIP logo

Comments (3)

asmala avatar asmala commented on May 18, 2024

I believe the URL syntax should be http://someurl?param[]=value1&param[]=value2.

from ring.

Josh-Tilles avatar Josh-Tilles commented on May 18, 2024

@asmala You're sorta correct. The syntax for PHP does require the [] suffix. However, according to this StackOverflow post, the suffix is just a PHP-ism.

The way I understand it:
If there's a GET request at http://someurl?argument=original, then the result of calling (.getParameterValues req "argument") would be ["original"] and the result of calling (.getParameterValue req "argument") would be "original".
If there's a GET request at http://someurl?argument=shadowing&argument=original, then the result of calling (.getParameterValues req "argument") would be ["shadowing" "original"], but the result of (.getParameterValue req "argument") would be "shadowing".

@weavejester, do you have an opinion on how to handle this?

from ring.

Josh-Tilles avatar Josh-Tilles commented on May 18, 2024

From looking at the current tests, it seems like Ring supports the PHP-style nested parameters. So I guess the main question is whether it should support both.

...time goes by in which I get distracted trying to implement this...

OH okay, if there is a problem, it doesn't (solely?) reside in ring.middleware.nested-params. I discovered this when writing a test for (array-map "foo" "bar" "foo" "baz"); if wrap-nested-params receives the parameters already as a map, then the fact that one input "key" had two values has been lost.

...goes off to explore the Ring codebase again...

from ring.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.