public class HttpUtil extends Object
| 构造器和说明 |
|---|
HttpUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static BufferedImage |
downloadImage(String urlStr)
请求获取图片, 只支持get请求
|
static Object |
requestMethod(String method,
String urlStr,
Object params,
String responseType,
Class<?> resultBeanClass)
用于get、post、put、delete请求,请求、接收参数都为对象
|
static String |
requestURL(String urlStr,
String params,
String method)
请求http服务
|
static String |
requestURLGet(String urlStr)
请求http服务 只支持GET请求
|
public static String requestURLGet(String urlStr)
urlStr - 请求路径public static String requestURL(String urlStr, String params, String method) throws Exception
urlStr - 请求路径params - 请求参数 json字符串method - 请求方法Exception - 抛出异常public static Object requestMethod(String method, String urlStr, Object params, String responseType, Class<?> resultBeanClass) throws Exception
method - 请求方式urlStr - 请求RULparams - 请求参数对象responseType - 返回数据类型resultBeanClass - 返回数据对象Exception - 抛出异常public static BufferedImage downloadImage(String urlStr)
urlStr - 请求路径Copyright © 2018 Pivotal Software, Inc.. All rights reserved.