jeudi 26 mars 2015

Dealing with multiple request argument values when you expect just one

When writing web apps I sometimes need to read request arguments. Of course people could specify a request argument zero, one or many times, but I generally expect just one instance. If I get a URL with multiple values for a given argument (eg /url?param=foo&param=bar) should I use the first argument, the last, or should I error out?





Aucun commentaire:

Enregistrer un commentaire