All Methods Instance Methods Concrete Methods
Modifier and Type |
Method and Description |
void |
addHeader(String key,
String value) |
void |
addHeaders(Map<String,String> headers) |
void |
addParam(String key,
Object value) |
void |
close()
关闭连接
|
void |
close(String remark)
关闭连接
|
HttpResponse |
forward(String newPath) |
HttpConst.RequestBodyFormat |
getBodyFormat() |
String |
getBodyString() |
Byte |
getByte(String name) |
ChannelContext |
getChannelContext() |
String |
getCharset() |
String |
getClientIp()
获取真实的客户端ip
|
String |
getConnection() |
int |
getContentLength() |
Cookie |
getCookie(String cooiename) |
Map<String,Cookie> |
getCookieMap() |
List<Cookie> |
getCookies() |
long |
getCreateTime() |
String |
getDomain()
根据host字段,获取去除端口的纯域名部分的值,形如:www.t-io.org, t-io.org等值
|
Double |
getDouble(String name) |
Float |
getFloat(String name) |
String |
getHeader(String key) |
Map<String,String> |
getHeaders() |
String |
getHost()
获取请求头中的host字段,形如:www.t-io.org:8080, www.t-io.org等值
|
HttpConfig |
getHttpConfig() |
HttpSession |
getHttpSession() |
Integer |
getInt(String name) |
Boolean |
getIsAjax() |
Boolean |
getIsSupportGzip() |
Long |
getLong(String name) |
Object |
getObject(String name) |
Map<String,Object> |
getParam()
把类型为数组的参数值转换成Object,相当于是取了数组的第一个值,便于业务开发(因为大部分参数值其实只有一个)
|
String |
getParam(String name) |
Object[] |
getParamArray(String name) |
Map<String,Object[]> |
getParams() |
String |
getReferer() |
Node |
getRemote() |
RequestLine |
getRequestLine() |
Short |
getShort(String name) |
String |
getString(String name)
同getParam(String name)
|
UploadFile |
getUploadFile(String name) |
String |
getUserAgent()
获取请求头中的User-Agent字段
|
boolean |
isClosed() |
boolean |
isForward() |
boolean |
isNeedForward() |
String |
logstr() |
void |
parseCookie(HttpConfig httpConfig) |
void |
removeHeader(String key,
String value) |
void |
setBodyFormat(HttpConst.RequestBodyFormat bodyFormat) |
void |
setBodyString(String bodyString) |
void |
setChannelContext(ChannelContext channelContext) |
void |
setCharset(String charset) |
void |
setClosed(boolean closed) |
void |
setConnection(String connection) |
void |
setContentLength(int contentLength) |
void |
setCookieMap(Map<String,Cookie> cookieMap) |
void |
setCookies(List<Cookie> cookies) |
void |
setCreateTime(long createTime) |
void |
setForward(boolean isForward) |
void |
setHeaders(Map<String,String> headers)
设置好header后,会把cookie等头部信息也设置好
|
void |
setHttpConfig(HttpConfig httpConfig) |
void |
setHttpSession(HttpSession httpSession) |
void |
setIsAjax(Boolean isAjax) |
void |
setIsSupportGzip(Boolean isSupportGzip) |
void |
setNeedForward(boolean needForward) |
void |
setParams(Map<String,Object[]> params) |
void |
setRemote(Node remote) |
void |
setRequestLine(RequestLine requestLine) |
String |
toString() |