类 HttpUtils
- java.lang.Object
-
- ai.yue.library.base.util.HttpUtils
-
public class HttpUtils extends java.lang.Object- 版本:
- 创建时间:2018年12月18日
- 作者:
- 孙金川
-
-
字段概要
字段 修饰符和类型 字段 说明 static java.lang.StringHTTP_TCP_NAMEstatic java.lang.StringHTTPS_TCP_NAMEstatic java.lang.StringPOINTCUTHttpAspect请求切入点
-
构造器概要
构造器 构造器 说明 HttpUtils()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static javax.servlet.http.HttpServletRequestgetRequest()获得当前请求上下文中的HttpServletRequeststatic org.springframework.web.context.request.ServletRequestAttributesgetRequestAttributes()获得当前请求上下文中的ServletRequestAttributesstatic javax.servlet.http.HttpServletResponsegetResponse()获得当前请求上下文中的HttpServletResponsestatic java.lang.StringgetServerURL()获得当前请求的服务器的URL地址static javax.servlet.http.HttpSessiongetSession()获得当前请求HttpSessionstatic voidprintRequest()打印请求报文
-
-
-
方法详细资料
-
getRequestAttributes
public static org.springframework.web.context.request.ServletRequestAttributes getRequestAttributes()
获得当前请求上下文中的ServletRequestAttributes- 返回:
- ServletRequestAttributes
-
getRequest
public static javax.servlet.http.HttpServletRequest getRequest()
获得当前请求上下文中的HttpServletRequest- 返回:
- HttpServletRequest
-
getResponse
public static javax.servlet.http.HttpServletResponse getResponse()
获得当前请求上下文中的HttpServletResponse- 返回:
- HttpServletResponse
-
getSession
public static javax.servlet.http.HttpSession getSession()
获得当前请求HttpSession- 返回:
- HttpSession
-
getServerURL
public static java.lang.String getServerURL()
获得当前请求的服务器的URL地址示例一:http://localhost:8080
示例二:http://localhost:8080/projectName- 返回:
- 当前请求的服务器的URL地址
-
printRequest
public static void printRequest()
打印请求报文注意:打印不包括:异步请求内容、数据流
-
-