Search code examples
javanettynio

How to I use io.netty.handler.codec.http.multipart.HttpPostRequestEncoder finalizeRequest


I am using netty 4.0 for a project. I encountered the following problem seeking answer:

In io.netty.handler.codec.http.multipart.HttpPostRequestEncoder finalizeRequest() method, around line 705, the method returned WrappedHttpRequest if (the realSize > ..chunkSize = 8k),

So this returned Object is not FullHttpRequest, with NO content (HttpContent) member. All other cases, the returned Object are subclass of FullHttpRequest with content.

How can I convert this to WrappedFullHttpRequest with content (body etc)? Thanks!


Solution

  • Check the multipart example it's shown there [1]

    [1] https://github.com/netty/netty/blob/master/example/src/main/java/io/netty/example/http/upload/HttpUploadClient.java#L261