northof40, ionel,
Thanks for the input! I went with the **kwargs idea since,
well, it
was the first response I got and once I started travelling
down that
road, I couldn't turn back
I was able to get it working using the code suggested by
northof40 below.
Thanks all for the quick response. I have to say that after
trying
out zope/plone, django and twisted, cherrypy seems like the
most solid
and intuitive way to launch web services. I'm very psyched
about the
potential.
Anyone else using cherrypy for web services other than html
servers?
matt
On 4/2/06, northof40 <shearichard gmail.com> wrote:
> Try this instead ...
>
> def index(*args, **kwargs):
> kwargslowercase = {}
> for k,v in kwargs.iteritems():
> kwargslowercase[str(k).lower()] = v
> #Now use kwargslowercase as a dictionary
> #of HTTP parameters all of which are lowercase
> #- just demonstrate that
> for v in kwargslowercase.itervalues():
> print v
On 4/2/06, Maries Ionel Cristian <ionel.mc gmail.com> wrote:
> 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 <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(), ]
> >
--
Matt Perry
perrygeo gmail.com
http://www.perrygeo.net
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
|