public class HttpRequestDecoder extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
HttpRequestDecoder.Step |
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
MAX_LENGTH_OF_HEADER
头部,最多有多少字节
|
static int |
MAX_LENGTH_OF_HEADERLINE
头部,每行最大的字节数
|
static int |
MAX_LENGTH_OF_REQUESTLINE
请求行的最大长度
|
| 构造器和说明 |
|---|
HttpRequestDecoder() |
| 限定符和类型 | 方法和说明 |
|---|---|
static HttpRequest |
decode(ByteBuffer buffer,
int limit,
int position,
int readableLength,
ChannelContext channelContext,
HttpConfig httpConfig) |
static void |
decodeParams(Map<String,Object[]> params,
String queryString,
String charset,
ChannelContext channelContext) |
static void |
parseBodyFormat(HttpRequest httpRequest,
Map<String,String> headers)
Content-Type : application/x-www-form-urlencoded; charset=UTF-8
Content-Type : application/x-www-form-urlencoded; charset=UTF-8
|
static boolean |
parseHeaderLine(ByteBuffer buffer,
Map<String,String> headers,
int headerLength,
HttpConfig httpConfig)
解析请求头的每一行
|
static RequestLine |
parseRequestLine(ByteBuffer buffer,
ChannelContext channelContext)
parse request line(the first line)
|
public static final int MAX_LENGTH_OF_HEADER
public static final int MAX_LENGTH_OF_HEADERLINE
public static final int MAX_LENGTH_OF_REQUESTLINE
public static HttpRequest decode(ByteBuffer buffer, int limit, int position, int readableLength, ChannelContext channelContext, HttpConfig httpConfig) throws AioDecodeException
buffer - limit - position - readableLength - channelContext - httpConfig - 可能为nullAioDecodeExceptionpublic static void decodeParams(Map<String,Object[]> params, String queryString, String charset, ChannelContext channelContext)
params - queryString - charset - channelContext - public static void parseBodyFormat(HttpRequest httpRequest, Map<String,String> headers)
httpRequest - headers - public static boolean parseHeaderLine(ByteBuffer buffer, Map<String,String> headers, int headerLength, HttpConfig httpConfig) throws AioDecodeException
line - headers - AioDecodeExceptionpublic static RequestLine parseRequestLine(ByteBuffer buffer, ChannelContext channelContext) throws AioDecodeException
line - GET /tio?value=tanyaowu HTTP/1.1channelContext - AioDecodeExceptionCopyright © 2018. All rights reserved.