OkHttp - 现代应用网络的方式

官网:Overview - OkHttp

HTTP is the way modern applications network. It's how we exchange data & media. Doing HTTP efficiently makes your stuff load faster and saves bandwidth.

OkHttp is an HTTP client that's efficient by default:

  • HTTP/2 support allows all requests to the same host to share a socket.
  • Connection pooling reduces request latency (if HTTP/2 isn't available).
  • Transparent GZIP shrinks download sizes.
  • Response caching avoids the network completely for repeat requests.

OkHttp perseveres when the network is troublesome: it will silently recover from common connection problems. If your service has multiple IP addresses, OkHttp will attempt alternate addresses if the first connect fails. This is necessary for IPv4+IPv6 and services hosted in redundant data centers. OkHttp supports modern TLS features (TLS 1.3, ALPN, certificate pinning). It can be configured to fall back for broad connectivity.

Using OkHttp is easy. Its request/response API is designed with fluent builders and immutability. It supports both synchronous blocking calls and async calls with callbacks.

相关推荐
xujiangyan_11 分钟前
linux的sysctl系统以及systemd系统。
linux·服务器·网络
吱吱企业安全通讯软件3 小时前
吱吱企业通讯软件保证内部通讯安全,搭建数字安全体系
大数据·网络·人工智能·安全·信息与通信·吱吱办公通讯
云边云科技5 小时前
零售行业新店网络零接触部署场景下,如何选择SDWAN
运维·服务器·网络·人工智能·安全·边缘计算·零售
rainFFrain5 小时前
Boost搜索引擎项目(详细思路版)
网络·c++·http·搜索引擎
AOwhisky5 小时前
Linux 文本处理三剑客:awk、grep、sed 完全指南
linux·运维·服务器·网络·云计算·运维开发
青草地溪水旁7 小时前
网络连接的核心机制
网络
花开富贵贼富贵8 小时前
计算机网络技术学习-day4《路由器配置》
网络·智能路由器·php
绵绵细雨中的乡音9 小时前
网络基础知识
linux·网络
想睡hhh10 小时前
网络基础——协议认识
网络·智能路由器
G_H_S_3_12 小时前
【网络运维】Linux 文本处理利器:sed 命令
linux·运维·网络·操作文本