public abstract class HttpRequestUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
private static String |
COOKIE_PARAMETER |
private static org.zodiac.commons.thread.EnhancedInheritableThreadLocal<Map<String,Map<String,String>>> |
holder |
private static org.slf4j.Logger |
LOGGER |
private static String |
POST_PARAMETER |
private static String |
QUERY_STRING |
| 限定符 | 构造器和说明 |
|---|---|
private |
HttpRequestUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
clearLocalThread() |
static void |
clearPostParameterMap() |
static io.netty.handler.codec.http.HttpRequest |
copy(io.netty.handler.codec.http.HttpRequest original) |
static Map<String,String> |
getBodyPamameters(io.netty.handler.codec.http.FullHttpRequest request) |
static Map<String,String> |
getBodyPamameters(io.netty.handler.codec.http.HttpRequest request,
io.netty.handler.codec.http.HttpContent httpContent) |
static String |
getCookie(String key) |
static Map<String,String> |
getCookieMap() |
static List<String> |
getHeaderValues(io.netty.handler.codec.http.HttpMessage httpMessage,
String headerName)
RFC7230/RFC7231/RFC7232/RFC7233/RFC7234 Each header field consists of a case-insensitive field name followed by a
colon (":"), optional leading whitespace, the field value, and optional trailing whitespace.
|
static org.zodiac.commons.model.network.HostAndPort |
getHostAndPort(String hostAndPort) |
static String |
getIpAddress(io.netty.handler.codec.http.HttpRequest request)
获取请求主机IP地址。
|
static String |
getPostParameter(String key) |
static Map<String,String> |
getPostParameterMap() |
static String |
getQueryString(String key) |
static Map<String,String> |
getQueryStringMap() |
static String |
getRealIp(io.netty.handler.codec.http.HttpRequest request) |
static String |
getRequestParameter(String key) |
static String |
getUrl(io.netty.handler.codec.http.HttpRequest request) |
static Map<String,String> |
geUrlPamameters(io.netty.handler.codec.http.HttpRequest request) |
static String |
identifyHostAndPort(io.netty.handler.codec.http.HttpRequest httpRequest) |
static void |
resetRequestBody(io.netty.handler.codec.http.FullHttpRequest realHttpObject,
String requestBody) |
static void |
resetRequestBody(io.netty.handler.codec.http.FullHttpRequest realHttpObject,
String requestBody,
Charset charset) |
static void |
setCookie(String key,
String value) |
static void |
setPostParameter(String key,
String value) |
static void |
setQueryString(String key,
String value) |
public static void clearPostParameterMap()
public static void clearLocalThread()
public static String identifyHostAndPort(io.netty.handler.codec.http.HttpRequest httpRequest)
public static org.zodiac.commons.model.network.HostAndPort getHostAndPort(String hostAndPort) throws UnknownHostException
public static String getIpAddress(io.netty.handler.codec.http.HttpRequest request) throws IOException
request - requestIOException - IOExceptionpublic static String getRealIp(io.netty.handler.codec.http.HttpRequest request)
public static String getUrl(io.netty.handler.codec.http.HttpRequest request)
public static List<String> getHeaderValues(io.netty.handler.codec.http.HttpMessage httpMessage, String headerName)
httpMessage - http messageheaderName - header namepublic static Map<String,String> geUrlPamameters(io.netty.handler.codec.http.HttpRequest request)
public static Map<String,String> getBodyPamameters(io.netty.handler.codec.http.HttpRequest request, io.netty.handler.codec.http.HttpContent httpContent)
public static Map<String,String> getBodyPamameters(io.netty.handler.codec.http.FullHttpRequest request)
public static io.netty.handler.codec.http.HttpRequest copy(io.netty.handler.codec.http.HttpRequest original)
public static void resetRequestBody(io.netty.handler.codec.http.FullHttpRequest realHttpObject,
String requestBody)
Copyright © 2022 Zodiac. All rights reserved.