1

How to send only form data in retrofit2 android. I have form data like key will be category and value will be some integer

Rudresh
  • 731
  • 1
  • 10
  • 26
  • 1
    Possible duplicate of [Retrofit 2 with only form-data](http://stackoverflow.com/questions/37814857/retrofit-2-with-only-form-data) – hrskrs Jan 18 '17 at 07:55
  • No that is for Multipart i want only for form data – Rudresh Jan 18 '17 at 08:00
  • You can find a tutorial with various form options and parameters here: https://futurestud.io/tutorials/retrofit-send-data-form-urlencoded – peitek Jan 19 '17 at 19:49

1 Answers1

0

In your retrofit interface:

@FormUrlEncoded
    @POST("yourPath")
    Call<YourResponseClass> callApi(@Field("category") int category_value);
Harry T.
  • 3,478
  • 2
  • 21
  • 41