postmanlabs/httpbin

chunked posts not seen in server

Opened this issue · 0 comments

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.