Is there any simple way in Retrofit
to convert passed object to JSON
automatically?
This is my Retrofit interface :
@FormUrlEncoded
@POST("/places/name")
void getPlacesByName(@Field("name") String name,
@Field("city") String city,
@Field("tags") Tags tags,
Callback<PlaceResponse> callback);
At first I thought that if I pass Tags
object it will be automatically converted to JSON
, but in reality request looks like this :
name=pubs&city=London&tags=com.app.database.model.Tags%4052aa38a8
Is there any simple way to convert POJO
to JSON
in Retrofit
?