05 How to create POST requests in an Android app using Retrofit 2.0

Video is ready, Click Here to View ×


Continuing on how to create Lets Code Easy app, we show you how to authenticate a user by making a POST method call to an Auth 2.0 service.

Retrofit 2.0 uses different kinds of data converters like GSON, OkHttp etc to deserialise the received JSON data from the REST API. We show you how to create the RestService interface and expose methods which directly map to the api endpoints.

Check out our Android app for all the uploaded playlists and videos:

YouTube Channel:

Website:

Social media:

android tutorials

coder

27 thoughts on “05 How to create POST requests in an Android app using Retrofit 2.0”

  1. Hello Sir, how can we save the response from the network call and use it later? What happens is if I try to keep any value from the response to a variable in my UI thread or any other class it gets null. I have tried SharedPreferences and it works fine but i want to store the response to an object even if the network thread is fiinished. Please help.

  2. Hello,

    I have a problem in the jar files. It says.

    Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
    > com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/maven/com.squareup.retrofit2/retrofit/pom.xml
    File1: /Users/admin/Desktop/Sample/app/libs/retrofit-2.0.2.jar
    File2: /Users/admin/.gradle/caches/modules-2/files-2.1/com.squareup.retrofit2/retrofit/2.0.2/43eeae0b9fb087bb3194ba59ab63a38a32fbf3e/retrofit-2.0.2.jar

    Thanks,

Leave a Reply

Your email address will not be published. Required fields are marked *