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.

相关推荐
v***44675 分钟前
PLC(电力载波通信)网络机制介绍
开发语言·网络·php
世界尽头与你6 分钟前
CVE-2014-3566: OpenSSL 加密问题漏洞
网络·安全·网络安全·渗透测试
L***B56810 分钟前
SQL 注入漏洞原理以及修复方法
网络·数据库·sql
ZeroNews内网穿透12 分钟前
ZeroNews IP 访问控制能力
服务器·网络·网络协议·tcp/ip·安全·web安全·小程序
vortex525 分钟前
网站压缩包上传解压功能的漏洞剖析
网络·安全·web安全
儒道易行39 分钟前
【钓鱼攻防】浅谈exe文件伪造ico图标上线CS远控
网络·安全·web安全
q***71011 小时前
跨域问题解释及前后端解决方案(SpringBoot)
spring boot·后端·okhttp
لا معنى له3 小时前
残差网络论文学习笔记:Deep Residual Learning for Image Recognition全文翻译
网络·人工智能·笔记·深度学习·学习·机器学习
爬山算法4 小时前
Redis(153)Redis的网络使用如何监控?
网络·redis·bootstrap
极地星光4 小时前
C++链式调用设计:打造优雅流式API
服务器·网络·c++