netty发送http请求,需要对请求和响应做编码处理
protected void initChannel(SocketChannel socketChannel) throws Exception { socketChannel.pipeline().addLast(new HttpRequestEncoder());//对发送的httpRequest进行编码 socketChannel.pipeline().addLast(new HttpResponseDecoder());//对返回的httpresopnse解码 // socketChannel.pipeline().addLast(new HttpClientCodec());//即对发送的httpRequest进行编码,也对返回的httpresopnse解码
}