public final class OkHttpTools extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
com.google.gson.Gson |
getGosn()
Gets gosn.
|
static OkHttpTools |
getInstance()
Gets instance.
|
String |
post(String url,
Map<String,String> params)
Post string.
|
String |
post(String url,
String json)
Post string.
|
<T> T |
post(String url,
String json,
Class<T> classOfT)
Post t.
|
public static OkHttpTools getInstance()
public String post(String url, String json) throws IOException
url - the urljson - the jsonIOException - the io exceptionpublic <T> T post(String url, String json, Class<T> classOfT) throws IOException
T - the type parameterurl - the urljson - the jsonclassOfT - the class of tIOException - the io exceptionpublic String post(String url, Map<String,String> params) throws IOException
url - the urlparams - the paramsIOException - the io exceptionpublic com.google.gson.Gson getGosn()
Copyright © 2020 dromara. All rights reserved.