Reputation: 33
I'm planning to replace Apache HTTP client with retrofit in my project. The problem I'm facing is that retrofit didn't(I couldn't find) support setting HTTP method to request at runtime. In my Web Service I don't know what HTTP method to call in advance, so annotations @GET, @POST, ... are useless.
Upvotes: 2
Views: 2776
Reputation: 4924
You can use Retrofit 2 for dynamic URL request with the new @Url annotation:
public interface CarService {
@GET
public Call<ImageResponse> getPicture(@Url String url);
}
Then just also create @POST, @PUT etc. You are going to have to make the choice somewhere.
Upvotes: 2