# Package com.drake.net.okhttp

## Functions

attachToNet
Link copied to clipboard
fun Call.attachToNet()
Content copied to clipboard
Call附着到Net上
cancelGroup
Link copied to clipboard
fun OkHttpClient.cancelGroup(group: Any?)
Content copied to clipboard
取消OkHttp客户端中指定Group的请求 如果使用的是Net创建的网络请求请使用com.drake.net.Net.cancelGroup
cancelId
Link copied to clipboard
fun OkHttpClient.cancelId(id: Any?)
Content copied to clipboard
取消OkHttp客户端中指定Id的请求 如果使用的是Net创建的网络请求请使用com.drake.net.Net.cancelId
detachFromNet
Link copied to clipboard
fun Call.detachFromNet()
Content copied to clipboard
Call从Net上分离释放引用
onDialog
Link copied to clipboard
fun OkHttpClient.Builder.onDialog(block: (FragmentActivity) -> Dialog): OkHttpClient.Builder
Content copied to clipboard
全局加载对话框设置 设置在使用scopeDialog自动弹出的加载对话框
onError
Link copied to clipboard
fun OkHttpClient.Builder.onError(block: Throwable.() -> Unit): OkHttpClient.Builder
Content copied to clipboard
全局网络请求错误捕获
onStateError
Link copied to clipboard
fun OkHttpClient.Builder.onStateError(block: Throwable.(view: View) -> Unit): OkHttpClient.Builder
Content copied to clipboard
全局缺省页错误捕获
setConverter
Link copied to clipboard
fun OkHttpClient.Builder.setConverter(converter: NetConverter): OkHttpClient.Builder
Content copied to clipboard
转换器
setDialogFactory
Link copied to clipboard
fun OkHttpClient.Builder.setDialogFactory(dialogFactory: NetDialogFactory): OkHttpClient.Builder
Content copied to clipboard
全局请求自动弹出的对话框会覆盖onDialog
setErrorHandler
Link copied to clipboard
fun OkHttpClient.Builder.setErrorHandler(handler: NetErrorHandler): OkHttpClient.Builder
Content copied to clipboard
全局错误处理器会覆盖onError和onStateError
setHost
Link copied to clipboard
fun OkHttpClient.Builder.setHost(host: String): OkHttpClient.Builder
Content copied to clipboard
设置全局默认的Host, 在使用com.drake.net.request.BaseRequest.setPath的时候会成为默认的Host
setLog
Link copied to clipboard
fun OkHttpClient.Builder.setLog(enabled: Boolean): OkHttpClient.Builder
Content copied to clipboard
开启日志
setRequestInterceptor
Link copied to clipboard
fun OkHttpClient.Builder.setRequestInterceptor(interceptor: RequestInterceptor): OkHttpClient.Builder
Content copied to clipboard
添加轻量级的请求拦截器, 可以在每次请求之前修改参数或者客户端配置 该拦截器不同于OkHttp的Interceptor无需处理请求动作
setSSLCertificate
Link copied to clipboard
fun OkHttpClient.Builder.setSSLCertificate(trustManager: X509TrustManager?, bksFile: InputStream? = null, password: String? = null): OkHttpClient.Builder
Content copied to clipboard
fun OkHttpClient.Builder.setSSLCertificate(vararg certificates: InputStream, bksFile: InputStream? = null, password: String? = null): OkHttpClient.Builder
Content copied to clipboard
toNetOkhttp
Link copied to clipboard
fun OkHttpClient.toNetOkhttp(): OkHttpClient
Content copied to clipboard
fun OkHttpClient.Builder.toNetOkhttp(): OkHttpClient.Builder
Content copied to clipboard
Net拦截器代理OkHttp
trustSSLCertificate
Link copied to clipboard
fun OkHttpClient.Builder.trustSSLCertificate(): OkHttpClient.Builder
Content copied to clipboard
信任所有证书