[undertow-dev] Retrieving request entity
Stuart Douglas
sdouglas at redhat.com
Sun Aug 17 19:34:24 EDT 2014
You can use the getRequestChannel() method to get the request channel.
Basically call read() on the channel till it returns either 0 or -1, if
it returns -1 you are done, if it returns 0 register a read listener and
call resumeReads().
I have always been meaning to add a nicer non-blocking API for this, but
I have never been exactly sure what would be required here. Thinking
about it we probably just need some way to buffer a complete/partial
message and then invoke a callback with the data.
Stuart
Vladimir Tsukur wrote:
> One of the ways to obtain request entity is to call
> HttpServerExchange.startBlocking and then read content from the
> HttpServerExchange.getInputStream.
>
> Is there a way to obtain request entity in a non-blocking way?
>
> --
> Vladimir Tsukur
> Software Architect, Design Engineer and Scrum Master
>
> _______________________________________________
> undertow-dev mailing list
> undertow-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/undertow-dev
More information about the undertow-dev
mailing list