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 hasReceivedHeaderLength,
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 TioDecodeException
buffer - limit - position - readableLength - channelContext - httpConfig - TioDecodeExceptionpublic static void decodeParams(Map<String,Object[]> params, String queryString, String charset, ChannelContext channelContext) throws TioDecodeException
params - queryString - charset - channelContext - TioDecodeExceptionpublic static void parseBodyFormat(HttpRequest httpRequest, Map<String,String> headers)
httpRequest - headers - public static boolean parseHeaderLine(ByteBuffer buffer, Map<String,String> headers, int hasReceivedHeaderLength, HttpConfig httpConfig) throws TioDecodeException
buffer - headers - hasReceivedHeaderLength - httpConfig - TioDecodeExceptionpublic static RequestLine parseRequestLine(ByteBuffer buffer, ChannelContext channelContext) throws TioDecodeException
line - GET /tio?value=tanyaowu HTTP/1.1channelContext - TioDecodeExceptionCopyright © 2022. All rights reserved.