Add Header Parameter in Retrofit
Try this type header for Retrofit 1.9 and 2.0. For the JSON content type. @Headers({“Accept: application/json”}) @POST(“user/classes”) Call<playlist> addToPlaylist(@Body PlaylistParm parm); You can add many more headers, i.e, @Headers({ “Accept: application/json”, “User-Agent: Your-App-Name”, “Cache-Control: max-age=640000” }) Dynamically add to headers: @POST(“user/classes”) Call<ResponseModel> addToPlaylist(@Header(“Content-Type”) String content_type, @Body RequestModel req); Call your method, i.e., mAPI.addToPlayList(“application/json”, playListParam); Or … Read more