OkHttp 4
See original GitHub issueSquare recently released OkHttp 4. It’s a Kotlin porting of OkHttp 3 with some minor changes and will be the basis of all the subsequent Square releases, so it’s important to upgrade gander, as it currently crashes when used in an app with OkHttp 4. I can help with a PR but I preferred to write here first to let you know and have your feedback about it.
This is the stack trace:
java.lang.NoSuchMethodError: No static method hasBody(Lokhttp3/Response;)Z in class Lokhttp3/internal/http/HttpHeaders; or its super classes
at com.ashokvarma.gander.GanderInterceptor.updateTransactionFromResponse(GanderInterceptor.java:250)
at com.ashokvarma.gander.GanderInterceptor.intercept(GanderInterceptor.java:161)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87)
And this is the official thread: https://github.com/square/okhttp/issues/5246 in which square devs advises to not rely on that method, but to copy and paste this one: https://github.com/square/okhttp/blob/eee838aebe8d3524d7e0e2dbf8f9bf357512f038/okhttp/src/main/java/okhttp3/internal/http/HttpHeaders.kt#L213
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Upgrading to OkHttp 4 - Square Open Source
OkHttp 4.x upgrades our implementation language from Java to Kotlin and keeps everything else the same. We've chosen Kotlin because it gives us...
Read more >OkHttp 4 Goes Kotlin - Cash App Code Blog
OkHttp is an HTTP client for Java and Android. Until today the library itself was all Java. With version 4 we've switched to...
Read more >A Guide to OkHttp - Baeldung
In this tutorial, we'll explore the basics of sending different types of HTTP requests, and receiving and interpreting HTTP responses.
Read more >com.squareup.okhttp3 » okhttp » 4.0.0-alpha01
OkHttp » 4.0.0-alpha01. Square's meticulous HTTP client for Java and Kotlin. License, Apache 2.0.
Read more >A complete guide to OkHttp - LogRocket Blog
The stable OkHttp 4.x works on Android 5.0+ (API level 21+) and Java 8+. If you require lower Android and Java version support, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Ashok-Varma made a check and it appears it was the only OkHttp internal method used 😉
Just as advice, to ease other developers contributions consider adding CONTRIBUTING.md and CODE_OF_CONDUCT.md to your repo. This can be useful as an example: https://gist.github.com/PurpleBooth/b24679402957c63ec426
Fantastic!!