Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP POST not working #72

Closed
theom opened this issue Jun 16, 2014 · 3 comments
Closed

HTTP POST not working #72

theom opened this issue Jun 16, 2014 · 3 comments
Labels

Comments

@theom
Copy link

theom commented Jun 16, 2014

An HTTP POST example would be really helpful as I'm struggling to read the payload data in the received request.

The generator returned by payload.read() (DataQueue.read()) never returns anything so either I'm doing something wrong or the generator is broken. I'm assuming here that the generator will return the POST payload data (I haven't gone through the aiohttp code in any detail to be sure) Some documentation and an example would be really helpful.

Is my assumption incorrect or should I be doing something completely different to get to the POST data?

I'm using jquery $.post to make the request.

Thanks,
JP

@theom theom changed the title HTTP POST example HTTP POST not working Jun 16, 2014
@fafhrd91
Copy link
Member

you probably should use wsgi server. it should work fine readpayload=True.
here is usual way to load payload::

try:
    while True:
        chunk = yield from payload.read()
except aiohttp.EofStream:
    pass

@theom
Copy link
Author

theom commented Jun 16, 2014

Well, that's basically what I'm doing so I'm a bit perplexed why I don't get the payload. I'll look at using wsgi and perhaps dig around in the innards of aiohttp to understand things a bit better.

Thanks for the suggestion.

@lock
Copy link

lock bot commented Oct 29, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants