public final class Http1ClientCodec
extends io.netty.channel.CombinedChannelDuplexHandler<io.netty.handler.codec.http.HttpResponseDecoder,io.netty.handler.codec.http.HttpRequestEncoder>
implements io.netty.handler.codec.http.HttpClientUpgradeHandler.SourceCodec
HttpRequestEncoder and HttpResponseDecoder
which enables easier client side HTTP implementation. Http1ClientCodec
provides additional state management for HEAD and CONNECT
requests, which HttpResponseDecoder lacks. Please refer to
HttpResponseDecoder to learn what additional state management needs
to be done for HEAD and CONNECT and why
HttpResponseDecoder can not handle it by itself.
If the Channel is closed and there are missing responses,
a PrematureChannelClosureException is thrown.
HttpServerCodec| Constructor and Description |
|---|
Http1ClientCodec()
Creates a new instance with the default decoder options
(
maxInitialLineLength (4096}, maxHeaderSize (8192), and
maxChunkSize (8192)). |
Http1ClientCodec(int maxInitialLineLength,
int maxHeaderSize,
int maxChunkSize)
Creates a new instance with the specified decoder options.
|
Http1ClientCodec(int maxInitialLineLength,
int maxHeaderSize,
int maxChunkSize,
boolean failOnMissingResponse)
Creates a new instance with the specified decoder options.
|
Http1ClientCodec(int maxInitialLineLength,
int maxHeaderSize,
int maxChunkSize,
boolean failOnMissingResponse,
boolean validateHeaders)
Creates a new instance with the specified decoder options.
|
Http1ClientCodec(int maxInitialLineLength,
int maxHeaderSize,
int maxChunkSize,
boolean failOnMissingResponse,
boolean validateHeaders,
boolean parseHttpAfterConnectRequest)
Creates a new instance with the specified decoder options.
|
Http1ClientCodec(int maxInitialLineLength,
int maxHeaderSize,
int maxChunkSize,
boolean failOnMissingResponse,
boolean validateHeaders,
int initialBufferSize)
Creates a new instance with the specified decoder options.
|
Http1ClientCodec(int maxInitialLineLength,
int maxHeaderSize,
int maxChunkSize,
boolean failOnMissingResponse,
boolean validateHeaders,
int initialBufferSize,
boolean parseHttpAfterConnectRequest)
Creates a new instance with the specified decoder options.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isSingleDecode() |
void |
prepareUpgradeFrom(io.netty.channel.ChannelHandlerContext ctx)
Prepares to upgrade to another protocol from HTTP.
|
void |
setSingleDecode(boolean singleDecode) |
void |
upgradeFrom(io.netty.channel.ChannelHandlerContext ctx)
Upgrades to another protocol from HTTP.
|
bind, channelActive, channelInactive, channelRead, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, close, connect, deregister, disconnect, exceptionCaught, flush, handlerAdded, handlerRemoved, inboundHandler, init, outboundHandler, read, removeInboundHandler, removeOutboundHandler, userEventTriggered, writepublic Http1ClientCodec()
maxInitialLineLength (4096}, maxHeaderSize (8192), and
maxChunkSize (8192)).public Http1ClientCodec(int maxInitialLineLength,
int maxHeaderSize,
int maxChunkSize)
public Http1ClientCodec(int maxInitialLineLength,
int maxHeaderSize,
int maxChunkSize,
boolean failOnMissingResponse)
public Http1ClientCodec(int maxInitialLineLength,
int maxHeaderSize,
int maxChunkSize,
boolean failOnMissingResponse,
boolean validateHeaders)
public Http1ClientCodec(int maxInitialLineLength,
int maxHeaderSize,
int maxChunkSize,
boolean failOnMissingResponse,
boolean validateHeaders,
boolean parseHttpAfterConnectRequest)
public Http1ClientCodec(int maxInitialLineLength,
int maxHeaderSize,
int maxChunkSize,
boolean failOnMissingResponse,
boolean validateHeaders,
int initialBufferSize)
public Http1ClientCodec(int maxInitialLineLength,
int maxHeaderSize,
int maxChunkSize,
boolean failOnMissingResponse,
boolean validateHeaders,
int initialBufferSize,
boolean parseHttpAfterConnectRequest)
public void prepareUpgradeFrom(io.netty.channel.ChannelHandlerContext ctx)
Encoder.prepareUpgradeFrom in interface io.netty.handler.codec.http.HttpClientUpgradeHandler.SourceCodecpublic void upgradeFrom(io.netty.channel.ChannelHandlerContext ctx)
Decoder and Encoder from
the pipeline.upgradeFrom in interface io.netty.handler.codec.http.HttpClientUpgradeHandler.SourceCodecpublic void setSingleDecode(boolean singleDecode)
public boolean isSingleDecode()
Copyright © 2020 LeanCloud. All rights reserved.