public class ApacheRequests extends Object
Modifier and Type | Method and Description |
---|---|
static ApacheDownload |
download(String url)
同步下载文件
|
static ApacheDownload |
download(String url,
org.apache.http.impl.client.CloseableHttpClient client)
同步下载文件
|
static ApacheRequest |
get()
获取get请求
|
static ApacheResponse |
get(String url)
get
|
static ApacheResponse |
get(String url,
Map<String,?> params)
get
|
static org.apache.http.impl.client.CloseableHttpClient |
getClient() |
static ApacheRequest |
post()
获取post请求
|
static ApacheResponse |
post(String url)
post
|
static ApacheResponse |
post(String url,
byte[] body)
post application/json
|
static ApacheResponse |
post(String url,
String body)
post application/json
|
static ApacheResponse |
post(String url,
String contentType,
byte[] body)
post
|
static ApacheResponse |
post(String url,
String contentType,
String body)
post
|
static void |
setClient(org.apache.http.impl.client.CloseableHttpClient client) |
static ApacheUpload |
upload(String url)
上传文件
|
static ApacheUpload |
upload(String url,
org.apache.http.impl.client.CloseableHttpClient client)
上传文件
|
public static ApacheResponse get(String url)
url
- urlpublic static ApacheResponse get(String url, Map<String,?> params)
url
- urlparams
- paramspublic static ApacheResponse post(String url)
url
- urlpublic static ApacheResponse post(String url, byte[] body)
url
- urlbody
- bodypublic static ApacheResponse post(String url, String body)
url
- urlbody
- bodypublic static ApacheResponse post(String url, String contentType, byte[] body)
url
- urlcontentType
- contentTypebody
- bodypublic static ApacheResponse post(String url, String contentType, String body)
url
- urlcontentType
- contentTypebody
- bodypublic static ApacheRequest get()
public static ApacheRequest post()
public static ApacheDownload download(String url)
url
- urlpublic static ApacheDownload download(String url, org.apache.http.impl.client.CloseableHttpClient client)
url
- urlclient
- clientpublic static ApacheUpload upload(String url)
url
- urlpublic static ApacheUpload upload(String url, org.apache.http.impl.client.CloseableHttpClient client)
url
- urlclient
- clientpublic static org.apache.http.impl.client.CloseableHttpClient getClient()
public static void setClient(org.apache.http.impl.client.CloseableHttpClient client)
Copyright © 2024. All rights reserved.