1

My api call is like this

@FormUrlEncoded
    @POST("/dealer/index.php")
    void getDealersPacks(
            @Query("r") String query,
            @Field("cd_dealer_id")
                    String cd_dealer_id,
            @Field("country_code")
                    String country_code,
            @Field("business_type")
                    String business_type, Callback<String> cb);

And i am getting this error

com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_STRING but was OBJECT at line 1 column 59 path $.
Goku
  • 9,102
  • 8
  • 50
  • 81
vineet sharma
  • 81
  • 1
  • 4

1 Answers1

1

The error says the method "getDealersPacks" is expecting a string value. But what you are sending as a parameter is an Object. So it is throwing syntax exception. Please properly check the data type of input params that you are sending.

TheHound.developer
  • 396
  • 1
  • 3
  • 16