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

[bug] aiohttp.post is broken #461

Closed
carlcarl opened this issue Aug 11, 2015 · 3 comments
Closed

[bug] aiohttp.post is broken #461

carlcarl opened this issue Aug 11, 2015 · 3 comments
Labels

Comments

@carlcarl
Copy link
Contributor

python version: 3.4.3
aiohttp==0.17.1

Hi, the post method is broken because it can't include data parameter, here is my test code and result:

import asyncio
import aiohttp

url = 'http://127.0.0.1:1234'
data = {'a': '11111'}

loop = asyncio.get_event_loop()

loop.run_until_complete(asyncio.wait([aiohttp.post(url, data=data)]))

Result(using nc -l 1234):

POST / HTTP/1.1
ACCEPT: */*
ACCEPT-ENCODING: gzip, deflate
HOST: 127.0.0.1:1234
CONTENT-LENGTH: 0
CONTENT-TYPE: application/octet-stream
CONNECTION: keep-alive
USER-AGENT: Python/3.4 aiohttp/0.17.1

if I use request instead of post, the result is OK:

POST / HTTP/1.1
ACCEPT: */*
ACCEPT-ENCODING: gzip, deflate
HOST: 127.0.0.1:1234
CONTENT-TYPE: application/x-www-form-urlencoded
CONTENT-LENGTH: 7
CONNECTION: keep-alive
USER-AGENT: Python/3.4 aiohttp/0.17.1

a=11111
@kxepal
Copy link
Member

kxepal commented Aug 11, 2015

I guess put, delete and patch are broken as well. data argument eventually forgot to be passed forward.

@asvetlov
Copy link
Member

Fixed. Will be published as part of 0.17.2

@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

3 participants