private void handleHttpContent(ChannelHandlerContext ctx, HttpContent chunk) throws Exception {
        if (decoder == null) {
            try {
                decoder = new HttpPostRequestDecoder(factory, request);
            } catch (ErrorDataDecoderException e1) {
                writeResponse(ctx.channel(), e1.getMessage());
                ctx.channel().close();
            } catch (IncompatibleDataDecoderException e1) {
                // GET Method: should not try to create a HttpPostRequestDecoder
                writeResponse(ctx.channel(), e1.getMessage());
            }
        }
        if (requestBody == null) {
            requestBody = new RequestBody();
        }

        if (decoder != null) {
            try {
                decoder.offer(chunk);
            } catch (ErrorDataDecoderException e1) {
                writeResponse(ctx.channel(), e1.getMessage());
                ctx.channel().close();
            }
        }
    }