要在 Gradle 构建中使用 OkHttp,我需要将以下依赖项添加到 Gradle 构建中。
compile 'com.squareup.okhttp:okhttp:2.5.0'
这是否意味着我正在使用实现熟悉的 java.net.HttpURLConnection
API 的 okhttp-urlconnection 模块或实现 Apache HttpClient API 的 okhttp-apache
模块?
最佳答案
你抄过线吗? :) :)
文档说:
You can try out OkHttp without rewriting your network code. The
okhttp-urlconnection
module implements the familiarjava.net.HttpURLConnection
API and theokhttp-apache
module implements the Apache HttpClient API.OkHttp supports Android 2.3 and above. For Java, the minimum requirement is 1.7.
关于java - 安卓okhttp库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34264151/