OkHttp 正在参加 2021 年度 OSC 中国开源项目评选,请投票支持!
OkHttp 在 2021 年度 OSC 中国开源项目评选 中已获得 {{ projectVoteCount }} 票,请投票支持!
2021 年度 OSC 中国开源项目评选 正在火热进行中,快来投票支持你喜欢的开源项目!
2021 年度 OSC 中国开源项目评选 >>> 中场回顾
OkHttp 获得 2021 年度 OSC 中国开源项目评选「最佳人气项目」 !
授权协议 Apache
开发语言 Java 查看源码 »
操作系统 跨平台
软件类型 开源软件
所属分类 程序开发网络工具包
开源组织
地区 不详
投 递 者 红薯
适用人群 未知
收录时间 2013-10-30

软件简介

okhttp 是一个 Java 的 HTTP+SPDY 客户端开发包,同时也支持 Android。

示例代码:

    OkHttpClient client = new OkHttpClient();

    String get(URL url) throws IOException {
      HttpURLConnection connection = client.open(url);
      InputStream in = null;
      try {
        // Read the response.
        in = connection.getInputStream();
        byte[] response = readFully(in);
        return new String(response, "UTF-8");
      } finally {
        if (in != null) in.close();
      }
    }
展开阅读全文

代码

的 Gitee 指数为
超过 的项目

评论

点击加入讨论🔥(5) 发布并加入讨论🔥
发表了资讯
2019/06/30 08:01

OkHttp 4 正式版发布,从 Java 切换到 Kotlin

OkHttp 4 正式版发布了,此版本最大的变化就是项目从 Java 迁移到了 Kotlin。 就像官方介绍的,“此版本改变了一切,又没什么改变”,我们此前在 OkHttp 4 的 RC 3 版本更新中已经报导过,OkHttp 4.x 将实现语言从 Java 切换到了 Kotlin,用等效的 .kt 替换了 25K 行的 .java,这就是改变了一切的意思。 而“没什么改变”是指项目保持了其它所有内容都不变,新版本是二进制和 Java 源兼容的,保留了与 Android 5+ 和 Java 8+ 相...

18
26
发表了资讯
2019/06/26 07:31

OkHttp 4.0.0 RC 3 发布,从 Java 切换到 Kotlin

OkHttp 4.0.0 RC 3 发布了,此版本修复了一个问题,在 okhttp3.internal.HttpMethod 中保留二进制兼容性。 OkHttp 是一个适用于 Android 和 Java 应用的 HTTP 和 HTTP/2 客户端,它的使用非常简单,支持阻塞式的同步请求和带回调的异步请求。 值得关注的是,OkHttp 4.x 将实现语言从 Java 切换到了 Kotlin,同时保持其它所有内容都不变,环境需要 Kotlin 1.3.40。所以现在 OkHttp 的介绍变成了:适用于 Android、Kotlin 与 Java...

34
13
发表了资讯
2019/05/20 07:05

OkHttp 3.14.2 发布,轻量的 Java 网络请求框架

OkHttp 3.14.2 已发布。OkHttp 是一个适用于 Android 和 Java 应用的 HTTP 和 HTTP/2 客户端,它使用非常简单的,支持阻塞式的同步请求和带回调的异步请求。 新版更新内容: 修复:从 HTTP/2 连接错误中恢复时,将路由锁定。有个 bug 是两个调用同时失败时,OkHttp 可能崩溃并抛出 NoSuchElementException,而不是预期的 IOException。 修复:格式化来自 HTTPS 代理的截断响应(truncated response)的错误消息时,不抛出 Null...

7
10
发表了资讯
2019/02/08 07:13

OkHttp 3.13.1 发布,轻量的 Java 网络请求框架

OkHttp 是一个适用于 Android 和 Java 应用的 HTTP 和 HTTP/2 客户端。OkHttp 的使用非常简单的,支持阻塞式的同步请求和带回调的异步请求。 OkHttp 支持 Android 2.3 及以上版本 Android 平台; 对于 Java,要求 JDK 1.7 以上。 更新内容如下: 修复:在Android上使用自定义 X509TrustManager 或 SSLSocket 时不再崩溃。 更新日志...

0
9
发表了资讯
2018/12/27 07:23

OkHttp 3.12.1 发布,轻量的 Java 网络请求框架

OkHttp 3.12.1 已发布,这是一个小的修复版本,移除了重叠的 package-info.java 。#详情 OkHttp 是一个适用于 Android 和 Java 应用的 HTTP 和 HTTP/2 客户端。OkHttp 的使用非常简单的,支持阻塞式的同步请求和带回调的异步请求。 OkHttp 支持 Android 2.3 及以上版本 Android 平台; 对于 Java,要求 JDK 1.7 以上。 下载地址: Source code(zip) Source code(tar.gz)...

6
14
发表了资讯
2018/07/15 21:50

OkHttp 3.11.0 发布,轻量的 Java 网络请求框架

OkHttp 3.11.0 已发布,OkHttp 是一个轻量的 Java 网络请求框架。 本次更新内容如下: OkHttp's new okhttp-tls submodule tames HTTPS and TLS. OkHttp now supports prior knowledge cleartext HTTP/2 New: HttpUrl.get(String) is an alternative to HttpUrl.parse(String) that throws an exception when the URL is malformed instead of returning null. New: The EventListener API previewed in OkHttp 3.9 has graduat...

3
5
发表了资讯
2018/02/26 17:26

OkHttp 3.10.0 发布,轻量的 Java 网络请求框架

OkHttp 3.10.0 发布了,OkHttp 是一个轻量的 Java 网络请求框架。本次更新内容如下: New: HttpUrl.addQueryParameter() percent-escapes more characters. Previously several ASCII punctuation characters were not percent-escaped when used with this method. This does not impact already-encoded query parameters in APIs like HttpUrl.parse() andHttpUrl.Builder.addEncodedQueryParameter(). New: CBC-mode ECDSA...

5
9
发表了资讯
2017/11/19 08:02

OkHttp 3.9.1 发布,轻量的 Java 网络请求框架

OkHttp 3.9.1 已发布,该版本更新内容不多,包含两个新特性和一个修复: Version 3.9.1 2017-11-18 New: Recover gracefully when Android's DNS crashes with an unexpected NullPointerException. New: Recover gracefully when Android's socket connections crash with an unexpected ClassCastException. Fix: Don't include the URL's fragment in encodedQuery() when the query itself is empty. 下载地址: Source cod...

2
22
发表了资讯
2017/09/11 10:36

OkHttp 3.9.0 发布,轻量的 Java 网络请求框架

okhttp 3.9.0 已发布,该版本包括大量 bug 修复,以及新功能,具体如下: Version 3.9.0 2017-09-03 Interceptors are more capable. The Chain interface now offers access to the call and can adjust all call timeouts. Note that this change is source-incompatible for code that implements the Chain interface. We don't expect this to be a problem in practice! OkHttp has an experimental new API for tracking...

9
36
发表了资讯
2017/06/19 10:40

okhttp 3.8.1 发布,HTTP+SPDY 客户端开发包

okhttp 3.8.1 发布了。okhttp 是一个 Java 的 HTTP+SPDY 客户端开发包,同时也支持 Android。 暂未发现该版本更新内容,请查看发行首页保持关注。 下载地址: Source code (zip) Source code (tar.gz)

3
14
发表了资讯
2017/05/15 10:30

okhttp 3.8.0 发布,HTTP+SPDY 客户端开发包

okhttp 3.8.0 发布了。okhttp 是一个 Java 的 HTTP+SPDY 客户端开发包,同时也支持 Android。 下载方式: Download the latest JAR or grab via Maven: <dependency>   <groupId>com.squareup.okhttp3</groupId>   <artifactId>mockwebserver</artifactId>   <version>3.8.0</version>   <scope>test</scope> </dependency> or Gradle: testCompile 'com.squareup.okhttp3:mockwebserver:3.8.0'...

7
21
发表了资讯
2017/04/18 13:40

okhttp 3.7.0 发布,HTTP+SPDY 客户端开发包

okhttp 3.7.0 发布了。okhttp 是一个 Java 的 HTTP+SPDY 客户端开发包,同时也支持 Android。 暂未提供更新内容。 下载地址: Source code (zip) Source code (tar.gz)

3
11
发表了资讯
2016/12/05 10:39

okhttp 3.5.0 发布,HTTP+SPDY 客户端开发包

okhttp 3.5.0 发布了,okhttp 是一个 Java 的 HTTP+SPDY 客户端开发包,同时也支持 Android。 更新内容: IP request with https Byte-Range Caching Certificate pinning should accept an expiration date 更多内容,点击此处查看。 下载地址: Source code (zip) Source code (tar.gz)...

3
16
发表了资讯
2016/07/11 00:00

okhttp 3.4.0 和 3.4.1 发布,HTTP+SPDY 客户端开发包

okhttp 3.4.0 和 3.4.1 发布了,okhttp 是一个 Java 的 HTTP+SPDY 客户端开发包,同时也支持 Android。 3.4.0 更新如下: New: Support dynamic table size changes to HPACK Encoder. Fix: Use TreeMap in Headers.toMultimap(). This makes string lookups on the returned map case-insensitive. Fix: Don't share the OkHttpClient's Dispatcher in HttpURLConnection. 下载地址 Source code (zip) Source code (tar.gz) 3...

7
17
发表了资讯
2016/07/04 00:00

okhttp 3.4.0 RC1 发布,HTTP+SPDY 客户端开发包

okhttp 3.4.0 RC1 发布了,更新如下: 改写了 HttpURLConnection 和 HttpsURLConnection. Cipher suites 现在可能有任意的名称。 Fix: CertificatePinner now matches canonicalized hostnames. Fix: Don’t crash on non-ASCII ETag headers. Previously OkHttp would reject these headers when validating a cached response. Fix: Don’t allow remote peer to arbitrarily size the HPACK decoder dynamic table. Fix: Hon...

0
11
发表了资讯
2016/05/30 00:00

okhttp 3.3.1 发布,HTTP+SPDY 客户端开发包

okhttp 3.3.1 发布,该版本主要是 Bug 修复,包括: Fix: The plaintext check in HttpLoggingInterceptor incorrectly classified newline characters as control characters. This is fixed. Fix: Don't crash reading non-ASCII characters in HTTP/2 headers or in cached HTTP headers. Fix: Retain the response body when an attempt to open a web socket returns a non-101 response code. okhttp 是一个 Java 的 HTTP...

9
24
发表了资讯
2016/05/26 00:00

okhttp 3.3.0 发布,HTTP 客户端开发包

okhttp 3.3.0 发布了,改进记录如下: New: Response.sentRequestAtMillis() and receivedResponseAtMillis()methods track the system's local time when network calls are made. These replace the OkHttp-Sent-Millis and OkHttp-Sent-Millis headers that were present in earlier versions of OkHttp. New: Accept user-provided trust managers in OkHttpClient.Builder. This allows OkHttp to satisfy its TLS requir...

13
28
发表了资讯
2016/03/02 00:00

okhttp 2.7.5 和 3.2.0 发布,HTTP 客户端开发包

okhttp 2.7.5 和 3.2.0 发布了,okhttp 是一个 Java 的 HTTP+SPDY 客户端开发包,同时也支持 Android。 okhttp 2.7.5 更新记录: Fix: Change the certificate pinner to always build full chains. This prevents a potential crash when using certificate pinning with the Google Play Services security provider. okhttp 3.2.0 更新记录: Fix: Change the certificate pinner to always build full chains. This prevent...

3
19
没有更多内容
加载失败,请刷新页面
点击加载更多
加载中
下一页
发表了博客
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
发表了问答
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
暂无内容
5 评论
169 收藏
分享
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部