public class HttpRequestDecoder extends Object
| 构造器和说明 |
|---|
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,
Charset charset) |
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,
HttpConfig httpConfig)
parse request line(the first line)
|
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, Charset charset) throws TioDecodeException
params - queryString - charset - TioDecodeExceptionpublic static void parseBodyFormat(HttpRequest httpRequest, Map<String,String> headers)
httpRequest - HttpRequestheaders - headerspublic 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, HttpConfig httpConfig) throws TioDecodeException
buffer - GET /tio?value=tanyaowu HTTP/1.1httpConfig - HttpConfigTioDecodeExceptionCopyright © 2023. All rights reserved.