转载

OkHttp parent-3.5.0 发布,一个高效的Http客户端

OkHttp parent-3.5.0 发布,一个高效的Http客户端

 

OkHttp是一个高效的Http客户端,在Android开发中被大量使用,主要有如下的特点:

  • 支持HTTP2/SPDY黑科技
  • socket自动选择最好路线,并支持自动重连
  • 拥有自动维护的socket连接池,减少握手次数
  • 拥有队列线程池,轻松写并发
  • 拥有Interceptors轻松处理请求与响应(比如透明GZIP压缩,LOGGING)
  • 基于Headers的缓存策略

更新日志

  • Fix: Prefer the server's response body on all conditional cache misses. Previously we would return the cached response's body if it had a newer Last-Modified date.
  • Fix: Update the stored timestamp on conditional cache hits.
  • New: Optimized HTTP/2 request header encoding. More headers are HPACK-encoded and string literals are now Huffman-encoded.
  • New: Expose Part headers and body in Multipart.
  • New: Make ResponseBody.string() and ResponseBody.charStream() BOM-aware. If your HTTP response body begins with a byte order mark it will be consumed and used to select a charset for the remaining bytes. Most applications should not not need a byte order mark.
  • Fix: Add a leading . for better domain matching in JavaNetCookieJar.
  • Fix: Gracefully recover from HTTP/2 connection shutdowns at start of request.
  • Fix: Be lenient if a MediaType's character set is 'single-quoted'.
  • Fix: Allow horizontal tab characters in header values.
  • Fix: When parsing HTTP authentication headers permit challenge parameters in any order.

 

下载

本站原创,转载时保留以下信息:
本文转自:深度开源(open-open.com)
原文地址:http://www.open-open.com/news/view/525f3bea

正文到此结束
Loading...