OkHttp 3 — How to send HTTP requests?

Aneh Thakur
TrinityTuts
Published in
1 min readMar 31, 2020

In this post, I will explain to you how we can send GET And POST request using OKHttp in Android Application. In my last post, I will explain how we can send GET and Post Request using Volley. OKHttp and Http & Http/2 client is widely used in android and java applications to create a request to the server. In this post, I am going to explain some most useful features of OKHttp.

OKHttp is the modern way to make and exchange data and media over the HTTP network. It helps to load data faster, efficiently and also saves bandwidth.

  • 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 is very easy to use. Its request/response API is designed with fluent builders and immutability. It supports both synchronous blocking calls and async calls with callbacks. Now we can start creating our android application.

Read the complete post here: How to send OKHTTP 3 Request?

--

--