|
List Info
Thread: Case-insensitive parameters
|
|
| Case-insensitive parameters |

|
2006-04-03 01:09:20 |
|
actualy alters the params dict not the request line  you got the idea... just have all parameters in lowercase in the serving methods
On 4/3/06, Maries Ionel Cristian
<gmail.com">ionel.mc gmail.com> wrote:
you could make a filter that alters the request line. for example:
class LowerParams: def before_request_body(this): cherrypy.request.params
= dict( [ (x[0].lower(),x[1]) for x in cherrypy.request.params.items() ] )
and have something like:
class Root: _cp_filters = [ LowerParams(), ]
....
On 4/3/06, gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
perrygeo gmail.com <gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
perrygeo gmail.com> wrote: Hello folks, I'm a new cherrypy user trying to implement a web service and I've
gotten everything working but...
I'm trying to implement the OGC Web Mapping Services standard which does not require any specific case for it's input parameters. For example, according to the spec, all of these are valid:
index?bbox=120,20,70,50 index?BBOX=120,20,70,50 index?BBox=120,20,70,50
My code has all variables as lower case. Is there any way to convert all input parameter names to lower-case?
Thanks for the help,
Matt Perry
ionel.
-- http://ionel.zapto.org ionel.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group. To post to this group, send email to cherrypy-users googlegroups.com To unsubscribe from this group, send email to cherrypy-users-unsubscribe googlegroups.com For more options, visit this group at http://groups.google.com/group/cherrypy-users -~----------~----~----~----~------~----~------~--~---
|
[1]
|
|
|
about | contact Other archives ( Real Estate discussion Medical topics )
|