public class HttpUnits_OKHTTP extends HttpUnits<okhttp3.OkHttpClient,okhttp3.RequestBody,okhttp3.Response>
| 构造器和说明 |
|---|
HttpUnits_OKHTTP(okhttp3.OkHttpClient httpClient)
Instantiates a new Http units okhttp.
|
HttpUnits_OKHTTP(okhttp3.OkHttpClient httpClient,
HttpLogConfig config)
Instantiates a new Http units.
|
| 限定符和类型 | 方法和说明 |
|---|---|
okhttp3.Response |
execute(HttpUnitAttr attr,
okhttp3.OkHttpClient httpclient,
okhttp3.Request request)
Execute response.
|
HttpResponse |
get(HttpUnitAttr attr,
HttpUnitRqParams params)
Get http response.
|
HttpResponse |
get(HttpUnitAttr attr,
String url)
Get http response.
|
HttpResponse |
get(HttpUnitAttr attr,
String url,
com.alibaba.fastjson.JSONObject params)
Get http response.
|
HttpResponse |
get(HttpUnitAttr attr,
String url,
Map<String,Object> params)
Get http response.
|
HttpResponse |
get(HttpUnitAttr attr,
String url,
Object params)
Get http response.
|
String |
getContent(HttpUnitAttr attr,
okhttp3.Response httpEntity)
Gets content.
|
protected HttpResponse |
getHttpResponse(HttpUnitAttr attr,
okhttp3.Response response) |
HttpUnitRqParams |
getHttpUnitRqParams(String url)
Gets http unit rq params.
|
HttpResponse |
json(HttpUnitAttr attr,
HttpUnitRqParams params)
Json http response.
|
HttpResponse |
post_json(HttpUnitAttr attr,
HttpUnitRqParams params)
Post json http response.
|
protected void |
setHeader(HttpUnitAttr attr,
okhttp3.Request.Builder builder) |
public HttpUnits_OKHTTP(okhttp3.OkHttpClient httpClient)
httpClient - the http clientpublic HttpUnits_OKHTTP(okhttp3.OkHttpClient httpClient,
HttpLogConfig config)
httpClient - the http clientrequestRecord - the request recordconfig - the configprotected void setHeader(HttpUnitAttr attr, okhttp3.Request.Builder builder)
public HttpResponse get(HttpUnitAttr attr, HttpUnitRqParams params)
HttpUnitspublic HttpResponse get(HttpUnitAttr attr, String url)
HttpUnitspublic HttpResponse get(HttpUnitAttr attr, String url, Map<String,Object> params)
HttpUnitspublic HttpResponse get(HttpUnitAttr attr, String url, com.alibaba.fastjson.JSONObject params)
HttpUnitspublic HttpResponse get(HttpUnitAttr attr, String url, Object params)
HttpUnitspublic HttpResponse json(HttpUnitAttr attr, HttpUnitRqParams params)
HttpUnitspublic HttpResponse post_json(HttpUnitAttr attr, HttpUnitRqParams params)
HttpUnitspublic String getContent(HttpUnitAttr attr, okhttp3.Response httpEntity)
HttpUnitsgetContent 在类中 HttpUnits<okhttp3.OkHttpClient,okhttp3.RequestBody,okhttp3.Response>attr - the attrhttpEntity - the http entitypublic HttpUnitRqParams getHttpUnitRqParams(String url)
HttpUnitsgetHttpUnitRqParams 在类中 HttpUnits<okhttp3.OkHttpClient,okhttp3.RequestBody,okhttp3.Response>url - the urlpublic okhttp3.Response execute(HttpUnitAttr attr, okhttp3.OkHttpClient httpclient, okhttp3.Request request) throws IOException
httpclient - the httpclientrequest - the requestIOException - the io exceptionprotected HttpResponse getHttpResponse(HttpUnitAttr attr, okhttp3.Response response)
Copyright © 2021. All rights reserved.