public class OkHttp3Impl extends AbstractSimpleHttp implements IOkhttp3
| Modifier and Type | Field and Description |
|---|---|
private okhttp3.OkHttpClient.Builder |
clientBuilder |
header, httpConfigFORM_DATA_UTF_8, JSON_UTF_8| Constructor and Description |
|---|
OkHttp3Impl() |
OkHttp3Impl(HttpConfig config) |
OkHttp3Impl(okhttp3.OkHttpClient.Builder clientBuilder) |
OkHttp3Impl(okhttp3.OkHttpClient.Builder clientBuilder,
HttpConfig config) |
getHttpConfig, setHeader, setHttpConfigclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbuildClient, buildHttpUrl, getRequestBuilder, postFormDataRequestBuild, postFormFileRequestBuild, postJsonRequestBuildpublic OkHttp3Impl()
public OkHttp3Impl(HttpConfig config)
public OkHttp3Impl(okhttp3.OkHttpClient.Builder clientBuilder)
public OkHttp3Impl(okhttp3.OkHttpClient.Builder clientBuilder,
HttpConfig config)
public SimpleHttpResponse get(String url)
SimpleHttpget in interface SimpleHttpurl - 请求地址public SimpleHttpResponse get(String url, Map<String,String> params)
SimpleHttpget in interface SimpleHttpurl - 请求地址params - 请求参数public SimpleHttpResponse post(String url)
SimpleHttppost in interface SimpleHttpurl - 请求地址public SimpleHttpResponse post(String url, String data)
SimpleHttppost in interface SimpleHttpurl - 请求地址data - 请求参数,json格式public SimpleHttpResponse post(String url, String dataJson, HttpHeader header)
SimpleHttppost in interface SimpleHttpurl - 请求地址dataJson - 请求参数,json格式header - 一次性请求头public SimpleHttpResponse postFormStr(String url, Map<String,String> formdata)
SimpleHttppostFormStr in interface SimpleHttpurl - 请求地址formdata - form 参数public SimpleHttpResponse postFormStr(String url, Map<String,String> formData, HttpHeader header)
SimpleHttppostFormStr in interface SimpleHttpurl - 请求地址formData - 表单参数header - 请求头public SimpleHttpResponse postFile(String url, String name, String filename, byte[] fileBytes)
SimpleHttppostFile in interface SimpleHttpurl - 请求地址name - 参数名称filename - 文件名称fileBytes - 需要上传的文件public SimpleHttpResponse postFile(String url, String name, File file)
SimpleHttppostFile in interface SimpleHttpurl - 请求地址name - 参数名称file - 文件public SimpleHttpResponse postFormFile(String url, Map<String,Object> formData)
SimpleHttppostFormFile in interface SimpleHttpurl - urlformData - 文件上传参数public SimpleHttpResponse postFormFile(String url, Map<String,Object> formData, HttpHeader header)
SimpleHttppostFormFile in interface SimpleHttpurl - urlformData - 文件上传参数header - 请求头private SimpleHttpResponse exec(okhttp3.Request.Builder requestBuilder)
Copyright © 2023. All rights reserved.