java - 安卓okhttp库

标签 java android okhttp android-networking androidhttpclient

要在 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 familiar java.net.HttpURLConnection API and the okhttp-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/

相关文章:

android - OkHttp 路由流量抛出 wifi 和 SocketFactory

java - 如何获取日期格式以大写月份和日期

启动 hbase 时未找到 JAVA_HOME。有什么建议么?

android - 无法使用 Android Studio 3.1/3.2 Canary 将 twitter-kit-android 集成到我的应用程序中

android - eclipse上的Android问题的OpenCV 2.4.9

android - 在 Android 应用程序中下载文件的最佳方式

java - 亚马逊云搜索 : Filter if exists

java - 不匹配不同语言的模式对象

android - android native 支持 RTP 和/或 SCTP 吗?

没有自签名证书的 javax.net.ssl.SSLPeerUnverifiedException : Hostname XXX not verified,