public class HttpConnetcion extends Object
┌─┐ ┌─┐
┌──┘ ┴───────┘ ┴──┐
│ │
│ ─── │
│ ─┬┘ └┬─ │
│ │
│ ─┴─ │
│ │
└───┐ ┌───┘
│ │
│ │
│ │
│ └──────────────┐
│ │
│ ├─┐
│ author:lelouch ┌─┘
│ │
└─┐ ┐ ┌───────┬──┐ ┌──┘
│ ─┤ ─┤ │ ─┤ ─┤
└──┴──┘ └──┴──┘
神兽保佑
代码无BUG!
| 限定符和类型 | 类和说明 |
|---|---|
static class |
HttpConnetcion.RequestProperty
已过时。
User-Agent Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.91 Safari/537.36
|
| 限定符和类型 | 字段和说明 |
|---|---|
protected int |
connectTimeout
已过时。
|
protected String |
contentCharset
已过时。
|
protected Map<String,List<String>> |
headerFields
已过时。
|
protected boolean |
needResult
已过时。
是否需要结果,不需要时返回 ResponseCode
|
protected String |
post
已过时。
|
protected int |
readTimeout
已过时。
|
protected int |
requestMethod
已过时。
|
protected Map<String,String> |
requestProperty
已过时。
|
protected int |
retry_time
已过时。
|
protected boolean |
testssl
已过时。
测试HTTPS 。
|
protected String |
url
已过时。
|
protected String |
url_302
已过时。
|
protected String |
userAgent
已过时。
|
| 构造器和说明 |
|---|
HttpConnetcion(String url)
已过时。
|
| 限定符和类型 | 方法和说明 |
|---|---|
Map<String,List<String>> |
getHeaderFields()
已过时。
|
Map<String,String> |
getRequestProperty()
已过时。
|
boolean |
isNeedResult()
已过时。
|
boolean |
isTestssl()
已过时。
|
protected void |
onException(Exception e)
已过时。
异常
|
protected void |
onResponseCodeException(int code)
已过时。
ResponseCode 不等于200
|
String |
request()
已过时。
请求 (GET)
|
String |
request(Map<String,Object> params)
已过时。
请求 (POST)
|
String |
requestXml(String xmlString)
已过时。
请求 (POST)
|
void |
setConnectTimeout(int connectTimeout)
已过时。
|
void |
setContentCharset(String contentCharset)
已过时。
|
void |
setNeedResult(boolean needResult)
已过时。
|
void |
setReadTimeout(int readTimeout)
已过时。
|
void |
setRequestProperty(Map<String,String> requestProperty)
已过时。
|
void |
setRetry_time(int retry_time)
已过时。
|
void |
setTestssl(boolean testssl)
已过时。
|
void |
setUserAgent(String userAgent)
已过时。
|
protected String contentCharset
protected int readTimeout
protected int connectTimeout
protected int retry_time
protected String userAgent
protected String url
protected String url_302
protected String post
protected boolean needResult
protected boolean testssl
protected int requestMethod
public HttpConnetcion(String url)
url - 网址public void setContentCharset(String contentCharset)
public void setReadTimeout(int readTimeout)
public void setConnectTimeout(int connectTimeout)
public void setRetry_time(int retry_time)
public boolean isNeedResult()
public void setNeedResult(boolean needResult)
public boolean isTestssl()
public void setTestssl(boolean testssl)
public void setUserAgent(String userAgent)
public String request()
public String request(Map<String,Object> params)
params - 参数files - 文件protected void onException(Exception e)
e - protected void onResponseCodeException(int code)
code - Copyright © 2020. All rights reserved.