HDTutorial
EN

Playback starts YouTube’s embedded player (privacy-enhanced mode).

Retrofit - Send a simple POST Request | Android Studio Tutorial

60,235 views September 3, 2020 9:12

Watch on YouTube
ChannelStevdza-San

Description from the creator

🏆 My Online Courses
⭐Discount Coupon: LAUNCH-STEVDZA-SAN
stevdza-san.com

🐱‍👤 Wanna become a member? Join!
youtube.com/channel/UCYLAirIEMMXtWOECuZAtjqQ/jo…

📸 Instagram
instagram.com/stevdza_san/


Retrofit is a Type Safe REST client for Android Developed by square. It uses okHttp library for HTTP requests, and it's one of the best tools for performing network requests in android applications. In this video I'll show you how to send POST request. For those of you who are not familiar with POST request. Basically POST is used to send data to a server to create/update a resource. The data sent to the server with POST request is stored in the request body of the HTTP request and not in the URL!

Retrofit requires three main components:
1. Retrofit Instance:
We can create an instance of Retrofit by Retrofit.Builder class. And we have to specify the base url and converter factory at the time of the Retrofit instance creation

2. Model Class:
Retrofit needs a Model class for sending and receiving Request. It uses the model class for parsing server Response by using converters like Gson, Moshi etc.

3. An Interface for possible API calls:
The interface contains methods that represents possible API calls. Each methods need a base Url end point annotation that represents the Http methods like GET, POST etc.

Project Files: github.com/stevdza-san/RetrofitDemo-Tutorial-Se…

About this tutorial

Stevdza-San published this 9:12 video tutorial on September 3, 2020. It has been watched 60,235 times on YouTube.

Category
Education
Duration
9:12
Published
September 3, 2020
Views
60,235
Likes
678

Share

This tutorial in other languages