Top Description Fields Constructors Methods
io.netty.handler.codec.http

public Class HttpServerExpectContinueHandler

extends ChannelInboundHandlerAdapter
Class Inheritance
Imports
io.netty.buffer.Unpooled, io.netty.channel.ChannelFutureListener, .ChannelHandlerContext, .ChannelInboundHandlerAdapter, io.netty.util.ReferenceCountUtil

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.

 io.netty.channel.ChannelPipeline p = ...;
 ...
 p.addLast("serverCodec", new HttpServerCodec());
 p.addLast("respondExpectContinue", new HttpServerExpectContinueHandler());
 ...
 p.addLast("handler", new HttpRequestHandler());
 

Field Summary

Modifier and TypeField and Description
private static final FullHttpResponse
private static final FullHttpResponse

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected HttpResponse
acceptMessage(HttpRequest request)

Produces a HttpResponse for HttpRequests which define an expectation.

public void
protected HttpResponse
rejectResponse(HttpRequest request)

Returns the appropriate 4XX HttpResponse for the given HttpRequest.

Inherited from io.netty.channel.ChannelInboundHandlerAdapter:
channelActivechannelInactivechannelReadCompletechannelRegisteredchannelUnregisteredchannelWritabilityChangedexceptionCaughtuserEventTriggered

Field Detail

ACCEPTback to summary
private static final FullHttpResponse ACCEPT
EXPECTATION_FAILEDback to summary
private static final FullHttpResponse EXPECTATION_FAILED

Constructor Detail

HttpServerExpectContinueHandlerback to summary
public HttpServerExpectContinueHandler()

Method Detail

acceptMessageback to summary
protected HttpResponse acceptMessage(HttpRequest request)

Produces a HttpResponse for HttpRequests which define an expectation. Returns null if the request should be rejected. See rejectResponse(HttpRequest).

channelReadback to summary
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception

Overrides io.netty.channel.ChannelInboundHandlerAdapter.channelRead.

Implements io.netty.channel.ChannelInboundHandler.channelRead.

Doc from io.netty.channel.ChannelInboundHandlerAdapter.channelRead.

Calls ChannelHandlerContext#fireChannelRead(Object) to forward to the next ChannelInboundHandler in the ChannelPipeline. Sub-classes may override this method to change behavior.

Annotations
@Override
rejectResponseback to summary
protected HttpResponse rejectResponse(HttpRequest request)

Returns the appropriate 4XX HttpResponse for the given HttpRequest.