Skip to content

Instantly share code, notes, and snippets.

@bumie-e
Last active February 7, 2021 21:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bumie-e/0334a8f69edae3605cc63986815130a8 to your computer and use it in GitHub Desktop.
Save bumie-e/0334a8f69edae3605cc63986815130a8 to your computer and use it in GitHub Desktop.
package com.bumie.dounix;
import java.util.List;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
public interface JsonPlaceholderApi {
// All doughnuts
@GET("doughnut")
Call<List<Model>> getDoughnuts();
@GET("doughnut/Speciality")
Call<List<Model>> getSpecialityDoughnut();
@POST("doughnut")
@FormUrlEncoded
Call<Model> addDoughnut(@Field("name") String name,
@Field("image") String image,
@Field("description") String description,
@Field("price") String price,
@Field("category") String category);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment