如何向DefaultHttpResponse添加内容?在Netty 3.x中有一个setContent()
- 方法。我找不到有关如何在Netty 4中使用HTTP类的任何细节。似乎有一些En / Decoders可以与HTTP数据包一起使用,但我不知道如何。
答案 0 :(得分:1)
您可以发送以下序列:
HttpResponse , n * HttpContent, LastHttpContent
只需使用
FullHttpResponse
DefaultHttpContent
,DefaultLastHttpContent
和DefaultFullHttpResponse
将ByteBuf作为构造函数参数。