public class HttpUtils extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static ThreadLocal<javax.servlet.http.HttpServletRequest> |
request |
| 构造器和说明 |
|---|
HttpUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static javax.servlet.http.HttpServletRequest |
getCurrentRequest() |
static org.springframework.web.context.request.ServletRequestAttributes |
getCurrentRequestAttributes() |
static Map<String,String> |
getCurrentRequestHeaders() |
static javax.servlet.http.HttpServletResponse |
getCurrentResponse() |
static Map<String,String> |
getHeaders(javax.servlet.http.HttpServletRequest request) |
static javax.servlet.http.Cookie |
readSingleCookieInRequestByName(String name)
读取当前request中对应名字的值的一个cookie
|
static void |
returnResponse(org.springframework.http.HttpStatus status,
Object object) |
static void |
returnResponse(int status,
Object object) |
public static final ThreadLocal<javax.servlet.http.HttpServletRequest> request
public static javax.servlet.http.HttpServletRequest getCurrentRequest()
public static javax.servlet.http.HttpServletResponse getCurrentResponse()
public static org.springframework.web.context.request.ServletRequestAttributes getCurrentRequestAttributes()
public static javax.servlet.http.Cookie readSingleCookieInRequestByName(String name)
name - cookie namepublic static Map<String,String> getHeaders(javax.servlet.http.HttpServletRequest request)
public static void returnResponse(org.springframework.http.HttpStatus status,
Object object)
throws IOException
IOExceptionpublic static void returnResponse(int status,
Object object)
throws IOException
IOExceptionCopyright © 2022. All rights reserved.