Okhttp v3.9.0
Download Jar File
Overview
Okttp یک کتابخانه ای برای ایجاد کلاینت HTTP و HTTP2 در نرم افزارهای جاوا و اندرویدی می باشد.
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 for services hosted in redundant data centers. OkHttp initiates new connections with modern TLS features (SNI, ALPN), and falls back to TLS 1.0 if the handshake fails.
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.
OkHttp supports Android 2.3 and above. For Java, the minimum requirement is 1.7.
پیاده سازی از طریق Repository ها
<dependency> <groupId>com.squareup.okhttp3</groupId> <artifactId>okhttp</artifactId> <version>3.9.0</version> </dependency>
compile 'com.squareup.okhttp3:okhttp:3.9.0'
ProGuard
اگر از ProGuard استفاده کنید، باید موارد زیر را در آن اضافه کنید تا این کتابخانه به درستی کار کند.
-dontwarn okhttp3.** -dontwarn okio.** -dontwarn javax.annotation.** # A resource is loaded with a relative path so the package of this class must be preserved. -keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase
کتابخانه های ضروری
کتابخانه Okhttp به موارد زیر برای درست کار کردن نیاز دارد:
- کتابخانه Okio
آموزش های مرتبط با این کتابخانه
به زودی…
نظرات ثبت شده بدون دیدگاه