public class HttpUtils extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static okhttp3.MediaType |
MEDIATYPE_JSON_UTF8 |
| 构造器和说明 |
|---|
HttpUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static ResponseVo |
call(okhttp3.Request request) |
static ResponseVo |
get(String url) |
static okhttp3.Response |
get(String url,
Map<String,String> headerMap) |
static okhttp3.Response |
post(String url) |
static okhttp3.Response |
post(String url,
Map<String,String> headerMap) |
static okhttp3.Response |
post(String url,
Map<String,String> headerMap,
List<String> paramNames,
List<String> paramValues) |
static okhttp3.Response |
post(String url,
Map<String,String> headerMap,
Map<String,String> paramMap) |
static okhttp3.Response |
post(String url,
Map<String,String> headerMap,
String bodyString) |
static ResponseVo |
uploadImage(String url,
File imageFile) |
public static okhttp3.Response get(String url, Map<String,String> headerMap) throws Exception
url - headerMap - Exceptionpublic static ResponseVo get(String url)
url - Exceptionpublic static ResponseVo uploadImage(String url, File imageFile)
public static okhttp3.Response post(String url, Map<String,String> headerMap, List<String> paramNames, List<String> paramValues) throws Exception
url - headerMap - paramNames - paramValues - Exceptionpublic static okhttp3.Response post(String url, Map<String,String> headerMap, Map<String,String> paramMap) throws Exception
url - headerMap - paramMap - Exceptionpublic static okhttp3.Response post(String url, Map<String,String> headerMap, String bodyString)
url - headerMap - bodyString - Exceptionpublic static okhttp3.Response post(String url, Map<String,String> headerMap) throws Exception
url - headerMap - Exceptionpublic static ResponseVo call(okhttp3.Request request)
Copyright © 2024. All rights reserved.