I have that structure for request.
Request getTransportByStation work perfectly.
But I get exception java.lang.IllegalArgumentException: TransportWebService.getTransportByRoute: Only one HTTP method is allowed. Found: GET and GET.
I found solution only for POST and POST.
interface TransportWebService {
@GET(QUERY_CATEGORY_TRANSPORT + "GetTransportByNextStation/{station}")
Observable<ResponseRouteList> getTransportByStation(
@Path("city") String city,
@Path("station") String station,
@Query("count") int count,
@Query("userid") String userId
);
@GET(QUERY_CATEGORY_TRANSPORT + "GetTransportByRoute/{route}")
Observable<ResponseRouteList> getTransportByRoute(
@Path("city") String city,
@Path("station") String route,
@Query("count") int count,
@Query("userid") String userId
);
@GET(QUERY_CATEGORY_TRANSPORT + "Time")
Observable<Integer> getTime(
@Path("city") String city
);
}
UPD: Retrofit version 1.9.0
Init service like this
private static final TransportWebService SERVICE = Common.getRestAdapter()
.setConverter(new GsonConverter(new Gson())
.build()
.create(TransportWebService.class);
In the second GET method, the second argument (@PATH("station")) should be @PATH("route").
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With