public class HttpRequestDecoder extends Object
| Constructor and Description |
|---|
HttpRequestDecoder() |
| Modifier and Type | Method and Description |
|---|---|
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 - bufferlimit - limitposition - positionreadableLength - readableLengthchannelContext - channelContexthttpConfig - httpConfigTioDecodeException - TioDecodeExceptionpublic static void decodeParams(Map<String,Object[]> params, String queryString, Charset charset) throws TioDecodeException
params - paramsqueryString - queryStringcharset - charsetTioDecodeException - 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 - bufferheaders - headershasReceivedHeaderLength - hasReceivedHeaderLengthhttpConfig - httpConfigTioDecodeException - TioDecodeExceptionpublic static RequestLine parseRequestLine(ByteBuffer buffer, HttpConfig httpConfig) throws TioDecodeException
buffer - GET /tio?value=tanyaowu HTTP/1.1httpConfig - HttpConfigTioDecodeException - TioDecodeExceptionCopyright © 2025. All rights reserved.