On Sep 25, 3:17 pm, Christopher Arndt <[EMAIL PROTECTED]> wrote:
> A client which does not supply the content-length for a POST request is
> not HTTP 1.0 compliant. From the RFC [1]:
>
> "A valid Content-Length is required on all HTTP/1.0 POST requests. An
> HTTP/1.0 server should respond with a 400 (bad request) message if it
> cannot determine the length of the request message's content."
That's good to know. I'm working with a third-party vendor, and I
don't trust that they'll always include that information.
For future reference, here's how I extract the post data:
import cherrypy
@expose()
def raw(self):
if cherrypy.request.method == "POST":
postdata = cherrypy.request.body.read()
# it is also possible to do this:
cl = int(cherrypy.request.headers['Content-Length'])
postdata = cherrypy.request.body.read(cl)
Thanks for the help!
Matt
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---