public class CloudHttpClient extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
HttpResult |
get(String url)
get请求
|
HttpResult |
get(String url,
int timeout)
get请求
|
static CloudHttpClient |
getInstance() |
HttpResult |
post(String url,
String data)
post请求
|
HttpResult |
post(String url,
String data,
int timeout)
post请求
|
HttpResult |
post(String url,
String data,
String contentType)
post请求
|
HttpResult |
post(String url,
String data,
String contentType,
int timeout)
post请求
|
public static CloudHttpClient getInstance()
public HttpResult get(String url) throws IOException
url - 请求地址IOException - io错误public HttpResult get(String url, int timeout) throws IOException
url - 请求地址timeout - 超时时间,单位:秒IOException - io错误public HttpResult post(String url, String data, String contentType, int timeout) throws IOException
url - 请求地址data - 请求内容contentType - 内容类型timeout - 超时时间,单位:秒IOException - io错误public HttpResult post(String url, String data, String contentType) throws IOException
url - 请求地址data - 请求内容contentType - 内容类型IOException - io错误public HttpResult post(String url, String data, int timeout) throws IOException
url - 请求地址data - 请求内容timeout - 超时时间,单位:秒IOException - io错误public HttpResult post(String url, String data) throws IOException
url - 请求地址data - 请求内容IOException - io错误Copyright © 2019. All rights reserved.