Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzicheng committed Aug 16, 2023
1 parent e7f6506 commit 4769331
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ repositories {
}

dependencies {
implementation("io.github.zicheng1992:cxhttp:1.1.2")
implementation("com.zhzc0x.cxhttp:cxhttp:1.2.1")
//默认网络请求库Okhttp3Call,如果使用其它网络库可去掉
implementation("com.squareup.okhttp3:okhttp:4.9.3")//最新版本不兼容Android4.4
implementation("com.squareup.okhttp3:logging-interceptor:4.9.3")
Expand All @@ -78,8 +78,12 @@ dependencies {
代码调用

```kotlin
val jacksonConverter = JacksonConverter()
CxHttpHelper.init(scope = MainScope(), debugLog = true, call = MyHttpCall(), converter = jacksonConverter)
val okhttp3Call = Okhttp3Call{
callTimeout(15, TimeUnit.SECONDS)
addInterceptor(HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY))
}
val jacksonConverter = JacksonConverter()
CxHttpHelper.init(scope=MainScope(), debugLog=true, call=MyHttpCall(okhttp3Call), converter=jacksonConverter)
CxHttpHelper.hookRequest{ request ->
request.param("id", "123456")
request.header("token", "1a2b3c4d5e6f")
Expand Down Expand Up @@ -143,7 +147,7 @@ dependencies {
```

# License
Copyright 2023 zicheng1992
Copyright 2023 zhzc0x

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down

0 comments on commit 4769331

Please sign in to comment.