1
0
mirror of https://github.com/square/okhttp.git synced 2025-08-10 11:03:02 +03:00

Use idiomatic Kotlin in Request.kt (#5092)

- define @get:JvmName(...) for the following vals in constructor instead of passing builder: Builder.
  - url: HttpUrl
  - method: String
  - headers: Headers
  - body: RequestBody?

- add @Deprecated(...) to the following functions.
  - fun url(): HttpUrl
  - fun method(): String
  - fun headers(): Headers
  - fun body(): RequestBody?
  - fun cacheControl(): CacheControl

- clean up code where ()(Parentheses) is unnecessarily used.
This commit is contained in:
monkey-mas
2019-05-22 15:55:00 -04:00
committed by Jesse Wilson
parent b21ed68c08
commit fa9118949e
23 changed files with 127 additions and 92 deletions

View File

@@ -30,7 +30,7 @@ class JavaNetAuthenticator : okhttp3.Authenticator {
override fun authenticate(route: Route?, response: Response): Request? {
val challenges = response.challenges()
val request = response.request()
val url = request.url()
val url = request.url
val proxyAuthorization = response.code() == 407
val proxy = route?.proxy() ?: Proxy.NO_PROXY