程序包 org.anyline.net
类 HttpUtil
java.lang.Object
org.anyline.net.HttpUtil
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static org.apache.http.impl.client.CloseableHttpClientstatic org.apache.http.impl.client.CloseableHttpClientstatic org.apache.http.impl.client.CloseableHttpClientcreateClient(String userAgent) static StringcreateFullPath(String host, String url) 创建完整HTTP路径static org.apache.http.impl.client.CloseableHttpClientcreateSSLClient(File keyFile, String protocol, String password) static org.apache.http.impl.client.CloseableHttpClientstatic org.apache.http.impl.client.CloseableHttpClientdefaultClient(String userAgent) static org.apache.http.impl.client.CloseableHttpClientstatic org.apache.http.impl.client.CloseableHttpClientdefaultSSLClient(String userAgent) static HttpResponsestatic HttpResponsestatic HttpResponsedelete(Map<String, String> headers, String url, String charset, List<org.apache.http.NameValuePair> pairs) static HttpResponsestatic HttpResponsedelete(Map<String, String> headers, String url, String charset, org.apache.http.NameValuePair... pairs) static Stringstatic DownloadTaskstatic DownloadTaskstatic DownloadTaskdownload(String url, File dst, Map<String, String> headers, Map<String, Object> params, boolean override) static DownloadTaskstatic DownloadTaskstatic DownloadTaskdownload(String url, String dest, Map<String, String> headers, Map<String, Object> params, boolean override) static DownloadTaskdownload(DownloadProgress progress, String url, File dst, boolean override) static DownloadTaskdownload(DownloadProgress progress, String url, File dst, Map<String, String> headers, Map<String, Object> params, boolean override) static DownloadTaskdownload(DownloadProgress progress, String url, String dest, boolean override) static DownloadTaskdownload(DownloadProgress progress, String url, String dest, Map<String, String> headers, Map<String, Object> params, boolean override) static Stringurl参数编码static HttpResponsestatic HttpResponsestatic HttpResponsestatic HttpResponsestatic HttpResponsestatic HttpResponsestatic HttpResponseget(Map<String, String> headers, String url, String charset, List<org.apache.http.NameValuePair> pairs) static HttpResponsestatic String提取url根目录static StringmergeParam(String url, String... params) 合并参数static StringmergeParam(String url, Map<String, Object> params) 合并参数static org.apache.http.entity.mime.MultipartEntityBuildermergeParam(org.apache.http.entity.mime.MultipartEntityBuilder builder, Map<String, Object> params, org.apache.http.entity.ContentType contetType) static Stringstatic List<org.apache.http.NameValuePair>packNameValuePair(Map<String, Object> params) static String提取一个URL所在的目录static StringparseFileName(String url) 提取一个URL指向的文件名static String从URL中提取文件目录(删除查询参数)static HttpResponsestatic HttpResponsestatic HttpResponsestatic HttpResponsestatic HttpResponsestatic HttpResponsestatic HttpResponsestatic HttpResponsestatic HttpResponsestatic HttpResponsestatic HttpResponsestatic HttpResponsestatic Stringread(InputStream is, String charset) static intstatic HttpResponsestatic HttpResponsestatic HttpResponsestatic HttpResponsestatic HttpResponsestatic HttpResponsestatic HttpResponseupload(String url, Map<String, Object> files, String charset, Map<String, String> headers, Map<String, Object> params) 文件上传static HttpResponsestatic HttpResponse
-
字段详细资料
-
PROTOCOL_TLSV1
-
-
构造器详细资料
-
HttpUtil
public HttpUtil()
-
-
方法详细资料
-
post
-
post
-
post
-
post
-
post
-
post
-
post
public static HttpResponse post(Map<String, String> headers, String url, org.apache.http.HttpEntity entity) -
post
-
post
-
put
-
put
-
put
-
stream
-
stream
-
stream
-
stream
-
stream
-
get
-
get
-
get
-
get
-
get
public static HttpResponse get(String url, String charset, List<org.apache.http.NameValuePair> pairs) -
get
-
get
-
get
-
delete
-
delete
-
delete
public static HttpResponse delete(String url, String charset, List<org.apache.http.NameValuePair> pairs) -
delete
-
delete
-
status
-
download
-
download
-
download
-
download
-
download
-
download
-
download
public static DownloadTask download(DownloadProgress progress, String url, String dest, boolean override) -
download
public static DownloadTask download(DownloadProgress progress, String url, File dst, boolean override) -
download
public static DownloadTask download(DownloadProgress progress, String url, String dest, Map<String, String> headers, Map<String, Object> params, boolean override) -
download
public static DownloadTask download(DownloadProgress progress, String url, File dst, Map<String, String> headers, Map<String, Object> params, boolean override) -
upload
-
upload
-
upload
-
upload
public static HttpResponse upload(String url, Map<String, Object> files, String charset, Map<String, String> headers, Map<String, Object> params) 文件上传- 参数:
url- urlfiles- File或byte[]或InputStream如果是url可以调用URL.openStream()获取输入流charset- 编码headers- headerparams- 参数- 返回:
- HttpResponse
-
mergePath
-
createFullPath
创建完整HTTP路径- 参数:
host- hosturl- url- 返回:
- String
-
host
提取url根目录- 参数:
url- url- 返回:
- String
-
domain
-
parsePath
从URL中提取文件目录(删除查询参数)- 参数:
url- url- 返回:
- String
-
parseDir
提取一个URL所在的目录- 参数:
url- url- 返回:
- String
-
parseFileName
提取一个URL指向的文件名- 参数:
url- url- 返回:
- String
-
read
-
mergeParam
合并参数- 参数:
url- urlparams- params- 返回:
- String
-
mergeParam
-
mergeParam
合并参数- 参数:
url- urlparams- params- 返回:
- String
-
packNameValuePair
-
client
-
client
-
defaultClient
public static org.apache.http.impl.client.CloseableHttpClient defaultClient() -
defaultClient
-
createClient
-
createSSLClient
-
defaultSSLClient
public static org.apache.http.impl.client.CloseableHttpClient defaultSSLClient() -
defaultSSLClient
-
encode
url参数编码- 参数:
src- 原文enable- 转换成是否可访问格式cn- 是否编译中文- 返回:
- String
-