I looked in Mochiweb, but I cannot find a way to read the body while I receive the request through the socket.
I'm not limited to Mochiweb, any other HTTP library would be good for me.
I also tried gen_tcp:listen(Port, [{packet, http}]), so I can read the body / headers while I receive the HTTP request, but I have to handle the responses manually and keep the socket open for more requests, so I prefer not to use this solution.
My intention is to receive a request with large bodies and not wait to get a full body to start reading / processing them.
source
share