I created the fork of asynchttpserver for the test: https://github.com/vegansk/asynchttpserver2 where you can read entire body using request.body.readAll, get the length of the request without reading it via request.body.len. And the main feature - you can read it via stream: request.body.getStream.
And the latter method is bothering me. asynchttpserver is async, standard streams are not. Thats why I want to write asyncstreams module for the standard library. What do you think about it?
Thats why I want to write asyncstreams module for the standard library. What do you think about it?
Sounds like a good idea :)
@vega
I think it is different between io of httpserver and stand stream. readChar readData ... are not useful. I think we need apis like recvOnClientError recvOnAChunk recvOn100Continue recvOnTimeout etc.
@_tulayang, I think that asyncstreams must implement generic streams, not http. And API that you suggest can be implemented in asynchttpserver or another http related module, but not in generic streams.
More opinions?