Retrofit: Unable to create @Body converter for class Retrofit: Unable to create @Body converter for class json json

Retrofit: Unable to create @Body converter for class


Solution:declare body value in your interface with next:

@Body RequestBody bodyand wrap String JSON object:

RequestBody body = RequestBody.create(MediaType.parse("application/json"), obj.toString());


there is chance of you kept same @SerializedName("") for multiple vairable/fields/tags


You can specify a Converter when you create the Retrofit like this

Retrofit retrofit = new Retrofit.Builder()        .addConverterFactory(GsonConverterFactory.create())        .baseUrl(baseurl)        .client(okHttpClient)        .build();