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
- Exception
public static okhttp3.Response get(String url) throws Exception
url
- Exception
public static okhttp3.Response post(String url, Map<String,String> headerMap, List<String> paramNames, List<String> paramValues) throws Exception
url
- headerMap
- paramNames
- paramValues
- Exception
public static okhttp3.Response post(String url, Map<String,String> headerMap, Map<String,String> paramMap) throws Exception
url
- headerMap
- paramMap
- Exception
public static okhttp3.Response post(String url, Map<String,String> headerMap, String bodyString) throws Exception
url
- headerMap
- bodyString
- Exception
public static okhttp3.Response post(String url, Map<String,String> headerMap) throws Exception
url
- headerMap
- Exception
Copyright © 2021. All rights reserved.