Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

retrofit

public interface MyApiEndpointInterface {
    // Request method and URL specified in the annotation

    @GET("users/{username}")
    Call<User> getUser(@Path("username") String username);

    @GET("group/{id}/users")
    Call<List<User>> groupList(@Path("id") int groupId, @Query("sort") String sort);

    @POST("users/new")
    Call<User> createUser(@Body User user);
}
Source by guides.codepath.com #
 
PREVIOUS NEXT
Tagged: #retrofit
ADD COMMENT
Topic
Name
3+4 =