Trying to send List to server and have Bad Request Error.
public interface PostReviewApi {
@FormUrlEncoded
@POST(\
Try using @Body annotation instead of @Field and passing a single ReviewBody object.
class ReviewBody {
public Review review;
public ReviewBody(int placeId, float rating, String content, List tagList) {
review = new Review(placeId, rating, content, tagList);
}
public class Review {
@SerializedName("place_id")
public int placeId;
public float rating;
public String content;
@SerializedName("tag_list")
public List tagList;
public Review(int placeId, float rating, String content, List tagList) {
this.placeId = placeId;
this.rating = rating;
this.content = content;
this.tagList = tagList;
}
}
}
@POST("/")
void addReview(@Body ReviewBody body, Callback callback);
(without @FormUrlEncoded)