On Feb 8, 2006, at 02:07, Bob Ippolito wrote:
Looks interesting, but your decorator is semi-broken.
simplejson.read (and simplejson.write) are deprecated and are going
to spew warnings every time you use them. They're cruft from json-
py compatibility.
The reason they're deprecated is because the methods "read" and
"write" almost always means something entirely different in Python
(e.g. file-like objects). You should be using loads/dumps (the
same API as marshal and pickle).
The most appropriate code would be simply this::
theDictionary = simplejson.load(cherrypy.request.body)
OK. Thanks for that. I'll change the code the next time I update it.
Additionally, JSON_INPUT is not a PEP-8 compliant name. It should
be called json_input.
Fair enough. The code was hacked up rather quickly. At the time I
didn't think it would work let alone see the light of day.
Thanks for the input.
Jon.