Class HttpServerExpectContinueHandler

java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.handler.codec.http.HttpServerExpectContinueHandler
All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler

public class HttpServerExpectContinueHandler extends io.netty.channel.ChannelInboundHandlerAdapter
Sends a 100 CONTINUE HttpResponse to HttpRequests which contain a 'expect: 100-continue' header. It should only be used for applications which do not install the HttpObjectAggregator.

By default it accepts all expectations.

Since HttpServerExpectContinueHandler expects HttpRequests it should be added after HttpServerCodec but before any other handlers that might send a HttpResponse.

  ChannelPipeline p = ...;
  ...
  p.addLast("serverCodec", new HttpServerCodec());
  p.addLast("respondExpectContinue", new HttpServerExpectContinueHandler());
  ...
  p.addLast("handler", new HttpRequestHandler());
  
  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

    io.netty.channel.ChannelHandler.Sharable
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected HttpResponse
    Produces a HttpResponse for HttpRequests which define an expectation.
    void
    channelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg)
     
    protected HttpResponse
    Returns the appropriate 4XX HttpResponse for the given HttpRequest.

    Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

    channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered

    Methods inherited from class io.netty.channel.ChannelHandlerAdapter

    ensureNotSharable, handlerAdded, handlerRemoved, isSharable

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.netty.channel.ChannelHandler

    handlerAdded, handlerRemoved
  • Constructor Details

    • HttpServerExpectContinueHandler

      public HttpServerExpectContinueHandler()
  • Method Details