类 HttpRequest
java.lang.Object
org.macrocloud.kernel.http.HttpRequest
ok http 封装,请求结构体
- 作者:
- macro
-
方法概要
修饰符和类型方法说明addCookie(okhttp3.Cookie cookie) async()authenticator(okhttp3.Authenticator authenticator) body(okhttp3.RequestBody requestBody) bodyString(String body) bodyString(okhttp3.MediaType contentType, String body) cacheControl(okhttp3.CacheControl cacheControl) connectTimeout(Duration timeout) cookieManager(okhttp3.CookieJar cookieJar) static HttpRequeststatic HttpRequest关闭 ssl 校验eventListener(okhttp3.EventListener eventListener) execute()followRedirects(boolean followRedirects) followSslRedirects(boolean followSslRedirects) static HttpRequeststatic HttpRequesthostnameVerifier(HostnameVerifier hostnameVerifier) interceptor(okhttp3.Interceptor interceptor) log()static HttpRequeststatic HttpRequeststatic HttpRequeststatic HttpRequestproxy(InetSocketAddress address) proxyAuthenticator(okhttp3.Authenticator proxyAuthenticator) proxySelector(ProxySelector proxySelector) static HttpRequeststatic HttpRequestqueryEncoded(String encodedQuery) queryEncoded(String encodedName, Object encodedValue) readTimeout(Duration readTimeout) removeHeader(String name) retry()retry(int maxAttempts, long sleepMillis) retry(int maxAttempts, long sleepMillis, Predicate<ResponseSpec> respPredicate) retryOn(Predicate<ResponseSpec> respPredicate) static voidsetGlobalLog(LogLevel logLevel) static voidsetHttpClient(okhttp3.OkHttpClient httpClient) sslSocketFactory(SSLSocketFactory sslSocketFactory, X509TrustManager trustManager) toString()writeTimeout(Duration writeTimeout)
-
方法详细资料
-
get
-
get
-
post
-
post
-
patch
-
patch
-
put
-
put
-
delete
-
delete
-
query
-
queryEncoded
-
queryMap
-
query
-
queryEncoded
-
formBuilder
-
multipartFormBuilder
-
body
-
bodyString
-
bodyString
-
bodyJson
-
execute
-
async
-
baseAuth
-
addHeader
-
addHeader
-
addHeader
-
setHeader
-
removeHeader
-
addCookie
-
cacheControl
-
userAgent
-
followRedirects
-
followSslRedirects
-
log
-
log
-
authenticator
-
interceptor
-
cookieManager
-
eventListener
-
connectTimeout
-
readTimeout
-
writeTimeout
-
proxy
-
proxySelector
-
proxyAuthenticator
-
retry
-
retryOn
-
retry
-
retry
-
disableSslValidation
关闭 ssl 校验- 返回:
- HttpRequest
-
hostnameVerifier
-
sslSocketFactory
public HttpRequest sslSocketFactory(SSLSocketFactory sslSocketFactory, X509TrustManager trustManager) -
toString
-
setHttpClient
public static void setHttpClient(okhttp3.OkHttpClient httpClient) -
setGlobalLog
-