Closed xboxplayer9889 closed 2 years ago
Although socket.recv() didn't work well for me, I have inspected this example and it helped me to rewrite my code to get any info (all the HEAD data with cookies, POST): https://github.com/micropython/micropython/blob/master/examples/network/http_server.py
This is expected behaviour, socket.recv(n)
reads at most n
bytes from the stream, but maybe less. It will not block if there is at least one 1 byte to return.
I see you have found a way forward, so will close the issue.
Thanks for answering,
But I'm happy I have learnt more about HTTP packets and I think not recv(bigbuffer) is the good solution.... Ty
ESP8266 (ESP8266EX, ESP-12F, v1.18 (2022-01-17) .bin)
socket.recv() doesn't get all data on POST
with GET I can receive all the data, but with POST if the request size bigger than 536byte I receive the first 536, and no more come, repeated recv hangs/waits too much, no error, but page cannot be served.
similar closed issue, same code: https://github.com/micropython/micropython/issues/7605#issue-957470751