Skip to content

request.body blocks when there is no POST body #116

@ryanpetrello

Description

@ryanpetrello

I have a very simple WSGI application. When the request has no POST body, request.body blocks:

from wsgiref.simple_server import make_server
from webob import Request, Response


class MyApp(object):

    def __call__(self, environ, start_response):
        request = Request(environ)
        response = Response()
        print request.body # blocks here
        response.body = 'Hello, World!'
        return response(environ, start_response)

httpd = make_server('localhost', 8080, MyApp())
try:
    httpd.serve_forever()
except KeyboardInterrupt:
    print '^C'

Making a request via curl:

curl -X POST http://localhost:8080/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions