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

chunked posts not seen in server #717

Open
rkvf01 opened this issue Feb 29, 2024 · 0 comments
Open

chunked posts not seen in server #717

rkvf01 opened this issue Feb 29, 2024 · 0 comments

Comments

@rkvf01
Copy link

rkvf01 commented Feb 29, 2024

I am running docker as follows

`sjc-mpago:test-postman-http ravkumar$ docker run -p 8000:80 kennethreitz/httpbin

[2024-02-29 03:33:46 +0000] [1] [INFO] Starting gunicorn 19.9.0
[2024-02-29 03:33:46 +0000] [1] [INFO] Listening at: http://0.0.0.0:80 (1)
[2024-02-29 03:33:46 +0000] [1] [INFO] Using worker: gevent
[2024-02-29 03:33:46 +0000] [10] [INFO] Booting worker with pid: 10`

My sample code to see if chunk is being accepted:

`import http.client

conn = http.client.HTTPConnection(host='127.0.0.1',port=8000)

url = "/post"
conn.putrequest('POST', url)
conn.putheader('Transfer-Encoding', 'chunked')
conn.endheaders()

data1="hello "
a= ""+ hex(len(data1)) + ' \r\n' +data1 + '\r\n'

data2="world "
b= ""+ hex(len(data2)) + ' \r\n' + data2 + '\r\n'

data= a+b+ '0 \r\n \r\n'
#print(data.encode('utf-8'))

conn.send(data.encode('utf-8'))
resp = conn.getresponse()
print(resp.status, resp.reason, resp.read())
conn.close()`

The connection just hangs at this point. Not sure if I am missing anything.. I saw the comment in core.py regarding
#340 but i think i am not facing that problem as i don't get any response.

if you enable print for data
b'0x6 \r\nhello \r\n0x6 \r\nworld \r\n0 \r\n \r\n'

Any help on this is appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant