Browsed by
Category: retrofit

EOFException: End of input at line 1 column 1 path $ 

EOFException: End of input at line 1 column 1 path $ 

EOFException: End of input at line 1 column 1 path $  or Retofit2 error java.io.EOFException: End of input at line 1 column 1 Reasons: This error message indicates a completely empty response, not the one you have indicated. If it’s an error you should be using errorBody() to get access to the data. If this is a normal response then you should yell at your server for returning no content when content was expected. But if you cannot change the server, consider using a…

Read More Read More

Retrofit take List data as POST request body in android rest api call

Retrofit take List data as POST request body in android rest api call

Step 1 :  create a request model that will take request body data package com.adn.api.order; import com.adn.Model.DBModel.AddToCartProductModel; import com.google.gson.annotations.SerializedName; import java.util.ArrayList; public class Order { @SerializedName(“customer_id”) String customer_id; @SerializedName(“firstname”) String firstname; @SerializedName(“lastname”) String lastname; @SerializedName(“email”) String email; @SerializedName(“products”) ArrayList<AddToCartProductModel> products; @SerializedName(“telephone”) String telephone; @SerializedName(“postcode”) String postcode; @SerializedName(“payment_method”) String payment_method; @SerializedName(“total_price”) String total_price; @SerializedName(“address”) String address; @SerializedName(“city”) String city; @SerializedName(“order_status”) String order_status; //Don’t forget to create/generate the getter and setter] public Order(String customer_id, String firstname, String lastname, String email, ArrayList<AddToCartProductModel> products,…

Read More Read More