Skip to content

Commit

Permalink
v1.1.1发布
Browse files Browse the repository at this point in the history
update README
  • Loading branch information
Rayhahah committed Apr 7, 2018
1 parent 0f6a25f commit 8dbf913
Showing 1 changed file with 24 additions and 15 deletions.
39 changes: 24 additions & 15 deletions README.md
Expand Up @@ -48,21 +48,30 @@
配置全局`OkHttpClient`

```
/**
* 构建OkHttpClient
* 使用这种方式构建的话,会直接配置成默认使用的OkHttpClient
*/
EClient {
timeUnit = TimeUnit.SECONDS
connectTimeout = 10
readTimeout = 10
writeTimeout = 10
interceptors()
networkInterceptors()
retryOnConnectionFailure = true
cache = Cache(getCachePathStr(), maxCacheSize.toLong())
}
/**
* 构建OkHttpClient
* 使用这种方式构建的话,会直接配置成默认使用的OkHttpClient
*/
EClient {
//配置默认的baseUrl
baseUrl = "http://mall.rayhahah.com/"
//配置默认的请求类型
type = TYPE.METHOD_POST
timeUnit = TimeUnit.SECONDS
connectTimeout = 10
readTimeout = 10
writeTimeout = 10
interceptors()
networkInterceptors()
retryOnConnectionFailure = true
cache = null
//配置默认的解析器
parser = null
//配置全局通用的请求头
header = {
"custom_head"("rayhahah")
}
}
```

或者直接传入自定义的`OkHttpClient`
Expand Down

0 comments on commit 8dbf913

Please sign in to comment.