Communicating with servers using OkHttp

OkHttp is an efficient and easy-to-use HTTP client. It supports both synchronous and asynchronous network calls. Using OkHttp on Android is easy. Simply add its dependency to a project's module-level build.gradle file:

implementation 'com.squareup.okhttp3:okhttp:3.9.0'

Get Kotlin Programming By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.