public final class ImResponse extends Object
该类为HTTP请求响应(Response)数据封装,所有与Response相关的数据均在该类封装提供。
HTTP Response class
This class is HTTP response (Response) data encapsulation, and all data related to Response is provided in this class package.
program: Sinlmao Commons Network Utils
description: HTTP Response类
create: 2019-08-01 11:11
| 限定符 | 构造器和说明 |
|---|---|
protected |
ImResponse()
禁止外部实例化
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected ImResponse |
addCookie(String name,
String data)
[内部] 添加Cookie数据
[Internal] Add cookie data
|
protected ImResponse |
addCookieProperty(ImResponseCookie imResponseCookie)
[内部] 添加Cookies属性数据
[Internal] Add cookie property data
|
void |
get(byte[] bytesContent)
使用传入参数Response应答Bytes消息
必须确定传入的bytes数组参数是空的,否则会被覆盖
Reply to Bytes message with incoming parameter Response
Must determine that the incoming bytes array parameter is empty, otherwise it will be overwritten
|
byte[] |
getBytesContent()
获得Response应答Bytes消息
Get the Response response bytes message
|
String |
getCookieData(String name)
根据Cookie键获取对象值
Get the object value according to the Cookie key
|
Set<String> |
getCookieNames()
获取Cookie的所有键
Get all the keys of the cookie
|
ImResponseCookie |
getCookieProperty(String name)
根据Cookie键获取对象属性
Get the object property according to the Cookie key
|
int |
getCookieSize()
获取Cookie长度
Get the size of the cookie
|
String |
getCookieStr()
获得Cookie数据完整字符
Get the full character of the cookie data
|
List<String> |
getHeaderData(String name)
根据Header键获取对象值
Get the object value according to the Header key
|
Set<String> |
getHeaderNames()
获取Header的所有键
Get all the keys of the header
|
int |
getHeaderSize()
获取Header长度
Get the size of the header
|
int |
getResponseCode()
获得Response状态码
Get the Response status code
|
String |
getResponseMessage()
获得Response状态消息
Get the Response status message
|
String |
getStringContent()
获得Response应答String消息
Get the Response response String message
|
protected ImResponse |
setBytesContent(byte[] bytesContent)
[内部] 设置Response应答bytes消息
[Internal] Set Response Reply bytes message
|
protected ImResponse |
setFullCookie(String data)
[内部] 添加Cookie完整数据
[Internal] Add full data for cookies
|
protected ImResponse |
setFullHeaders(Map<String,List<String>> headers)
[内部] 添加Header完整数据
[Internal] Add Header full data
|
protected ImResponse |
setResponseCode(int responseCode)
[内部] 设置Response状态码
[Internal] Set the Response status code
|
protected ImResponse |
setResponseMessage(String responseMessage)
[内部] 设置Response状态消息
[Internal] Set the Response status message
|
protected ImResponse |
setStringContent(String stringContent)
[内部] 设置Response应答String消息
[Internal] Set Response Reply String Message
|
protected ImResponse setResponseCode(int responseCode)
[Internal] Set the Response status code
responseCode - Response状态码 protected ImResponse setResponseMessage(String responseMessage)
[Internal] Set the Response status message
responseMessage - Response状态消息 protected ImResponse setStringContent(String stringContent)
[Internal] Set Response Reply String Message
stringContent - Response应答String消息 protected ImResponse setBytesContent(byte[] bytesContent)
[Internal] Set Response Reply bytes message
bytesContent - Response应答bytes消息 protected ImResponse setFullCookie(String data)
[Internal] Add full data for cookies
data - Cookie完整数据 protected ImResponse addCookie(String name, String data)
[Internal] Add cookie data
name - Cookie键 data - Cookie值 protected ImResponse addCookieProperty(ImResponseCookie imResponseCookie)
[Internal] Add cookie property data
imResponseCookie - Cookie键 protected ImResponse setFullHeaders(Map<String,List<String>> headers)
[Internal] Add Header full data
headers - Header完整数据 public int getResponseCode()
Get the Response status code
public String getResponseMessage()
Get the Response status message
public String getStringContent()
Get the Response response String message
public byte[] getBytesContent()
Get the Response response bytes message
public void get(byte[] bytesContent)
必须确定传入的bytes数组参数是空的,否则会被覆盖
Reply to Bytes message with incoming parameter Response
Must determine that the incoming bytes array parameter is empty, otherwise it will be overwritten
bytesContent - 空的Response应答Bytes接收对象 public String getCookieStr()
Get the full character of the cookie data
public String getCookieData(String name)
Get the object value according to the Cookie key
name - Cookie键 public ImResponseCookie getCookieProperty(String name)
Get the object property according to the Cookie key
name - Cookie键 public Set<String> getCookieNames()
Get all the keys of the cookie
public int getCookieSize()
Get the size of the cookie
public List<String> getHeaderData(String name)
Get the object value according to the Header key
name - Header键 public Set<String> getHeaderNames()
Get all the keys of the header
public int getHeaderSize()
Get the size of the header
Copyright © 2021. All rights reserved.