public class ApacheHttp extends Object
| 构造器和说明 |
|---|
ApacheHttp() |
| 限定符和类型 | 方法和说明 |
|---|---|
String |
delete(HttpApacheConfig config)
以Delete方式,请求资源或服务
|
String |
delete(org.apache.http.client.HttpClient client,
String url,
org.apache.http.Header[] headers,
org.apache.http.protocol.HttpContext context,
String encoding)
以Delete方式,请求资源或服务
|
OutputStream |
down(HttpApacheConfig config)
下载文件
|
OutputStream |
down(org.apache.http.client.HttpClient client,
String url,
org.apache.http.Header[] headers,
org.apache.http.protocol.HttpContext context,
OutputStream out)
下载文件
|
String |
get(HttpApacheConfig config)
以Get方式,请求资源或服务
|
String |
get(org.apache.http.client.HttpClient client,
String url,
org.apache.http.Header[] headers,
Map<String,Object> paramMap,
org.apache.http.protocol.HttpContext context,
String encoding)
以Get方式,请求资源或服务
|
String |
get(String url)
以Get方式,请求资源或服务
|
String |
get(String url,
org.apache.http.Header[] headers)
以Get方式,请求资源或服务
|
String |
get(String url,
org.apache.http.Header[] headers,
Map<String,Object> paramMap)
以Get方式,请求资源或服务
|
String |
get(String url,
org.apache.http.Header[] headers,
Map<String,Object> paramMap,
String encoding)
以Get方式,请求资源或服务
|
String |
get(String url,
org.apache.http.Header[] headers,
String encoding)
以Get方式,请求资源或服务
|
String |
get(String url,
Map<String,Object> paramMap)
以Get方式,请求资源或服务
|
String |
get(String url,
Map<String,Object> paramMap,
String encoding)
以Get方式,请求资源或服务
|
String |
get(String url,
String encoding)
以Get方式,请求资源或服务
|
String |
head(HttpApacheConfig config)
以Head方式,请求资源或服务
|
String |
head(org.apache.http.client.HttpClient client,
String url,
org.apache.http.Header[] headers,
org.apache.http.protocol.HttpContext context,
String encoding)
以Head方式,请求资源或服务
|
String |
options(HttpApacheConfig config)
以Options方式,请求资源或服务
|
String |
options(org.apache.http.client.HttpClient client,
String url,
org.apache.http.Header[] headers,
org.apache.http.protocol.HttpContext context,
String encoding)
以Options方式,请求资源或服务
|
String |
patch(HttpApacheConfig config)
以Patch方式,请求资源或服务
|
String |
patch(org.apache.http.client.HttpClient client,
String url,
Map<String,Object> parasMap,
org.apache.http.Header[] headers,
org.apache.http.protocol.HttpContext context,
String encoding)
以Patch方式,请求资源或服务
|
String |
post(HttpApacheConfig config)
以post方式,请求资源或服务
|
String |
post(org.apache.http.client.HttpClient client,
String url,
org.apache.http.Header[] headers,
Map<String,Object> paramMap,
org.apache.http.protocol.HttpContext context,
String encoding)
以post方式,请求资源或服务
|
String |
post(String url)
以post方式,请求资源或服务
|
String |
post(String url,
org.apache.http.Header[] headers)
以post方式,请求资源或服务
|
String |
post(String url,
org.apache.http.Header[] headers,
Map<String,Object> paramMap)
以v方式,请求资源或服务
|
String |
post(String url,
org.apache.http.Header[] headers,
Map<String,Object> paramMap,
String encoding)
以post方式,请求资源或服务
|
String |
post(String url,
org.apache.http.Header[] headers,
String encoding)
以post方式,请求资源或服务
|
String |
post(String url,
Map<String,Object> paramMap)
以post方式,请求资源或服务
|
String |
post(String url,
Map<String,Object> paramMap,
String encoding)
以post方式,请求资源或服务
|
String |
post(String url,
String encoding)
以post方式,请求资源或服务
|
String |
put(HttpApacheConfig config)
以Put方式,请求资源或服务
|
String |
put(org.apache.http.client.HttpClient client,
String url,
Map<String,Object> parasMap,
org.apache.http.Header[] headers,
org.apache.http.protocol.HttpContext context,
String encoding)
以Put方式,请求资源或服务
|
static OutputStream |
resp2Stream(org.apache.http.HttpResponse resp,
OutputStream out)
转化为流
|
String |
send(HttpApacheConfig config)
请求资源或服务
|
int |
status(HttpApacheConfig config)
查看资源链接情况,返回状态码
|
int |
status(org.apache.http.client.HttpClient client,
String url,
org.apache.http.Header[] headers,
org.apache.http.protocol.HttpContext context,
HttpMethod method)
查看资源链接情况,返回状态码
|
String |
trace(HttpApacheConfig config)
以Trace方式,请求资源或服务
|
String |
trace(org.apache.http.client.HttpClient client,
String url,
org.apache.http.Header[] headers,
org.apache.http.protocol.HttpContext context,
String encoding)
以Trace方式,请求资源或服务
|
String |
upload(HttpApacheConfig config)
上传文件
|
String |
upload(org.apache.http.client.HttpClient client,
String url,
org.apache.http.Header[] headers,
org.apache.http.protocol.HttpContext context)
上传文件
|
public String get(String url) throws Exception
url - 资源地址Exceptionpublic String get(String url, org.apache.http.Header[] headers) throws Exception
url - 资源地址headers - 请求头信息Exceptionpublic String get(String url, Map<String,Object> paramMap) throws Exception
url - 资源地址paramMap - 请求参数Exceptionpublic String get(String url, org.apache.http.Header[] headers, Map<String,Object> paramMap) throws Exception
url - 资源地址headers - 请求头信息paramMap - 请求参数Exceptionpublic String get(String url, Map<String,Object> paramMap, String encoding) throws Exception
url - 资源地址paramMap - 请求参数encoding - 编码Exceptionpublic String get(String url, org.apache.http.Header[] headers, Map<String,Object> paramMap, String encoding) throws Exception
url - 资源地址headers - 请求头信息paramMap - 请求参数encoding - 编码Exceptionpublic String get(String url, String encoding) throws Exception
url - 资源地址encoding - 编码Exceptionpublic String get(String url, org.apache.http.Header[] headers, String encoding) throws Exception
url - 资源地址headers - 请求头信息encoding - 编码Exceptionpublic String get(org.apache.http.client.HttpClient client, String url, org.apache.http.Header[] headers, Map<String,Object> paramMap, org.apache.http.protocol.HttpContext context, String encoding) throws Exception
client - client对象url - 资源地址headers - 请求头信息paramMap - 请求参数context - http上下文,用于cookie操作encoding - 编码Exceptionpublic String get(HttpApacheConfig config) throws Exception
config - 请求参数配置Exceptionpublic String post(String url) throws Exception
url - 资源地址Exceptionpublic String post(String url, org.apache.http.Header[] headers) throws Exception
url - 资源地址headers - 请求头信息Exceptionpublic String post(String url, Map<String,Object> paramMap) throws Exception
url - 资源地址paramMap - 请求参数Exceptionpublic String post(String url, org.apache.http.Header[] headers, Map<String,Object> paramMap) throws Exception
url - 资源地址headers - 请求头信息paramMap - 请求参数Exceptionpublic String post(String url, Map<String,Object> paramMap, String encoding) throws Exception
url - 资源地址paramMap - 请求参数encoding - 编码Exceptionpublic String post(String url, org.apache.http.Header[] headers, Map<String,Object> paramMap, String encoding) throws Exception
url - 资源地址headers - 请求头信息paramMap - 请求参数encoding - 编码Exceptionpublic String post(String url, String encoding) throws Exception
url - 资源地址encoding - 编码Exceptionpublic String post(String url, org.apache.http.Header[] headers, String encoding) throws Exception
url - 资源地址headers - 请求头信息encoding - 编码Exceptionpublic String post(org.apache.http.client.HttpClient client, String url, org.apache.http.Header[] headers, Map<String,Object> paramMap, org.apache.http.protocol.HttpContext context, String encoding) throws Exception
client - client对象url - 资源地址headers - 请求头信息paramMap - 请求参数context - http上下文,用于cookie操作encoding - 编码Exceptionpublic String post(HttpApacheConfig config) throws Exception
config - 请求参数配置Exceptionpublic String put(org.apache.http.client.HttpClient client, String url, Map<String,Object> parasMap, org.apache.http.Header[] headers, org.apache.http.protocol.HttpContext context, String encoding) throws Exception
client - client对象url - 资源地址parasMap - 请求参数headers - 请求头信息context - http上下文,用于cookie操作encoding - 编码Exceptionpublic String put(HttpApacheConfig config) throws Exception
config - 请求参数配置Exceptionpublic String delete(org.apache.http.client.HttpClient client, String url, org.apache.http.Header[] headers, org.apache.http.protocol.HttpContext context, String encoding) throws Exception
client - client对象url - 资源地址headers - 请求头信息context - http上下文,用于cookie操作encoding - 编码Exceptionpublic String delete(HttpApacheConfig config) throws Exception
config - 请求参数配置Exceptionpublic String patch(org.apache.http.client.HttpClient client, String url, Map<String,Object> parasMap, org.apache.http.Header[] headers, org.apache.http.protocol.HttpContext context, String encoding) throws Exception
client - client对象url - 资源地址parasMap - 请求参数headers - 请求头信息context - http上下文,用于cookie操作encoding - 编码Exceptionpublic String patch(HttpApacheConfig config) throws Exception
config - 请求参数配置Exceptionpublic String head(org.apache.http.client.HttpClient client, String url, org.apache.http.Header[] headers, org.apache.http.protocol.HttpContext context, String encoding) throws Exception
client - client对象url - 资源地址headers - 请求头信息context - http上下文,用于cookie操作encoding - 编码Exceptionpublic String head(HttpApacheConfig config) throws Exception
config - 请求参数配置Exceptionpublic String options(org.apache.http.client.HttpClient client, String url, org.apache.http.Header[] headers, org.apache.http.protocol.HttpContext context, String encoding) throws Exception
client - client对象url - 资源地址headers - 请求头信息context - http上下文,用于cookie操作encoding - 编码Exceptionpublic String options(HttpApacheConfig config) throws Exception
config - 请求参数配置Exceptionpublic String trace(org.apache.http.client.HttpClient client, String url, org.apache.http.Header[] headers, org.apache.http.protocol.HttpContext context, String encoding) throws Exception
client - client对象url - 资源地址headers - 请求头信息context - http上下文,用于cookie操作encoding - 编码Exceptionpublic String trace(HttpApacheConfig config) throws Exception
config - 请求参数配置Exceptionpublic OutputStream down(org.apache.http.client.HttpClient client, String url, org.apache.http.Header[] headers, org.apache.http.protocol.HttpContext context, OutputStream out) throws Exception
client - client对象url - 资源地址headers - 请求头信息context - http上下文,用于cookie操作out - 输出流Exceptionpublic OutputStream down(HttpApacheConfig config) throws Exception
config - 请求参数配置Exceptionpublic String upload(org.apache.http.client.HttpClient client, String url, org.apache.http.Header[] headers, org.apache.http.protocol.HttpContext context) throws Exception
client - client对象url - 资源地址headers - 请求头信息context - http上下文,用于cookie操作Exceptionpublic String upload(HttpApacheConfig config) throws Exception
config - 请求参数配置Exceptionpublic int status(org.apache.http.client.HttpClient client,
String url,
org.apache.http.Header[] headers,
org.apache.http.protocol.HttpContext context,
HttpMethod method)
throws Exception
client - client对象url - 资源地址headers - 请求头信息context - http上下文,用于cookie操作Exceptionpublic int status(HttpApacheConfig config) throws Exception
config - 请求参数配置Exceptionpublic String send(HttpApacheConfig config) throws Exception
config - 请求参数配置Exceptionpublic static OutputStream resp2Stream(org.apache.http.HttpResponse resp, OutputStream out) throws Exception
resp - 响应对象out - 输出流ExceptionCopyright © 2017. All rights reserved.