Retrofit multiple POST params
Maybe this can help:
@Multipart
@POST("/venues/get-by-location")
void getByLocation(@Part("coordinates") Coordinates coordinates,
@Part("maxDistanceBody") MaxDistanceBody maxDistance,
Callback callback);
If you just want to send them as a regular body, you can create a helper class that contains all your values. Something like:
KOTLIN:
class VenuesRequestBody(coordinates: Coordinates, maxDistance: MaxDistance)
-
@POST("/venues/get-by-location")
fun getByLocation(@Body loginRequest: LoginRequest): Call<MyCallback>
JAVA (written without testing):
public class VenuesRequestBody {
Coordinates coordinates;
MaxDistance maxDistance;
VenuesRequestBody(Coordinates coordinates, MaxDistance maxDistance) {
this.coordinates = coordinates;
this.maxDistance = maxDistance;
}
}
-
@POST("/venues/get-by-location")
void getByLocation(@Body VenuesRequestBody requestBody,
Callback<MyCallback> callback);