public class HttpRequestDecoder extends Object
Modifier and Type | Class and Description |
---|---|
static class |
HttpRequestDecoder.Step |
Modifier and Type | Field and Description |
---|---|
static int |
MAX_LENGTH_OF_HEADER
头部,最多有多少字节
|
static int |
MAX_LENGTH_OF_HEADERLINE
头部,每行最大的字节数
|
Constructor and Description |
---|
HttpRequestDecoder() |
Modifier and Type | Method and Description |
---|---|
static HttpRequest |
decode(ByteBuffer buffer,
org.tio.core.ChannelContext channelContext,
boolean isBody) |
static void |
decodeParams(Map<String,Object[]> params,
String paramsStr,
String charset,
org.tio.core.ChannelContext channelContext) |
static void |
main(String[] args) |
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 KeyValue |
parseHeaderLine(String line)
解析请求头的每一行
|
static RequestLine |
parseRequestLine(String line,
org.tio.core.ChannelContext channelContext)
解析第一行(请求行)
|
public static final int MAX_LENGTH_OF_HEADER
public static final int MAX_LENGTH_OF_HEADERLINE
public static HttpRequest decode(ByteBuffer buffer, org.tio.core.ChannelContext channelContext, boolean isBody) throws org.tio.core.exception.AioDecodeException
org.tio.core.exception.AioDecodeException
public static void decodeParams(Map<String,Object[]> params, String paramsStr, String charset, org.tio.core.ChannelContext channelContext)
public static void main(String[] args)
args
- public static void parseBodyFormat(HttpRequest httpRequest, Map<String,String> headers)
httpRequest
- headers
- public static KeyValue parseHeaderLine(String line)
line
- public static RequestLine parseRequestLine(String line, org.tio.core.ChannelContext channelContext) throws org.tio.core.exception.AioDecodeException
line
- channelContext
- org.tio.core.exception.AioDecodeException
Copyright © 2018. All rights reserved.