public class OkHttp3SyncImpl extends AbstractSyncHttp implements IOkhttp3
| Modifier and Type | Field and Description |
|---|---|
private okhttp3.OkHttpClient.Builder |
clientBuilder |
header, httpConfigFORM_DATA_UTF_8, JSON_UTF_8| Constructor and Description |
|---|
OkHttp3SyncImpl() |
OkHttp3SyncImpl(HttpConfig config) |
OkHttp3SyncImpl(okhttp3.OkHttpClient.Builder clientBuilder,
HttpConfig config) |
| Modifier and Type | Method and Description |
|---|---|
String |
execStr(okhttp3.Request.Builder requestBuilder) |
InputStream |
execStream(okhttp3.Request.Builder requestBuilder) |
String |
get(String url)
get 请求
|
String |
get(String url,
Map<String,String> params)
get 请求
|
String |
post(String url)
post请求
|
String |
post(String url,
Map<String,String> formdata)
post请求
|
String |
post(String url,
String data)
post请求
|
String |
post(String url,
String dataJson,
HttpHeader header)
post请求
|
InputStream |
postStream(String url,
String dataJson)
post请求
|
getHttpConfig, setHeader, setHttpConfigclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbuildClient, buildHttpUrl, getRequestBuilder, postFormDataRequestBuild, postJsonRequestBuildpublic OkHttp3SyncImpl()
public OkHttp3SyncImpl(HttpConfig config)
public OkHttp3SyncImpl(okhttp3.OkHttpClient.Builder clientBuilder,
HttpConfig config)
public String get(String url, Map<String,String> params)
SyncHttppublic String post(String url, String dataJson, HttpHeader header)
SyncHttppublic InputStream postStream(String url, String dataJson)
SyncHttppostStream in interface SyncHttpurl - 请求地址dataJson - 请求参数,json格式public String post(String url, Map<String,String> formdata)
SyncHttppublic String execStr(okhttp3.Request.Builder requestBuilder)
public InputStream execStream(okhttp3.Request.Builder requestBuilder)
Copyright © 2022. All rights reserved.