public class HttpUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static okhttp3.OkHttpClient |
client |
static okhttp3.MediaType |
MEDIATYPE_JSON_UTF8 |
| Constructor and Description |
|---|
HttpUtils() |
| Modifier and Type | Method and Description |
|---|---|
static okhttp3.Response |
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) |
public static final okhttp3.MediaType MEDIATYPE_JSON_UTF8
public static final okhttp3.OkHttpClient client
public static okhttp3.Response get(String url, Map<String,String> headerMap) throws Exception
url - headerMap - Exceptionpublic static okhttp3.Response get(String url) throws Exception
url - Exceptionpublic 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) throws Exception
url - headerMap - bodyString - Exceptionpublic static okhttp3.Response post(String url, Map<String,String> headerMap) throws Exception
url - headerMap - ExceptionCopyright © 2021. All rights reserved.