public abstract class HttpClient extends Client
| 限定符和类型 | 字段和说明 |
|---|---|
protected static okhttp3.MediaType |
BINARY |
protected static okhttp3.MediaType |
FORM |
protected static okhttp3.MediaType |
JSON |
protected okhttp3.OkHttpClient |
okHttpClient |
protected okhttp3.Request |
request |
| 构造器和说明 |
|---|
HttpClient(HttpBuilder builder) |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
getCallTimeout() |
int |
getConnectTimeout() |
okhttp3.OkHttpClient |
getOkHttpClient() |
int |
getReadTimeout() |
okhttp3.Request |
getRequest() |
boolean |
getRetryOnConnectionFailure() |
int |
getWriteTimeout() |
protected String |
sendPost(String url,
Map<String,String> header,
Map<String,String> body) |
protected String |
sendPost(String url,
okhttp3.MediaType mediaType,
Map<String,String> header,
byte[] body) |
protected String |
sendPost(String url,
okhttp3.MediaType mediaType,
Map<String,String> header,
String body) |
protected String |
sendPost(String url,
okhttp3.MediaType mediaType,
String body) |
getApiKey, getApiSecret, getAppId, getHostUrlprotected static final okhttp3.MediaType JSON
protected static final okhttp3.MediaType FORM
protected static final okhttp3.MediaType BINARY
protected okhttp3.Request request
protected okhttp3.OkHttpClient okHttpClient
public HttpClient(HttpBuilder builder)
public okhttp3.Request getRequest()
public okhttp3.OkHttpClient getOkHttpClient()
protected String sendPost(String url, okhttp3.MediaType mediaType, Map<String,String> header, String body) throws IOException
IOExceptionprotected String sendPost(String url, okhttp3.MediaType mediaType, String body) throws IOException
IOExceptionprotected String sendPost(String url, okhttp3.MediaType mediaType, Map<String,String> header, byte[] body) throws IOException
IOExceptionprotected String sendPost(String url, Map<String,String> header, Map<String,String> body) throws IOException
IOExceptionpublic boolean getRetryOnConnectionFailure()
public int getCallTimeout()
public int getConnectTimeout()
public int getReadTimeout()
public int getWriteTimeout()
Copyright © 2021. All rights reserved.