I am using Retrofit v2.4.0 in my project. I need to get token using one API call and using this token in header of the POST request I should use another API call where I should add one header and two parameter to the body of the request. The following code is of the second API call (JavaRx is used):
@FormUrlEncoded
@POST("auth/sendCode")
@Headers("Content-Type: application/json")
Single<SendCodeResponse> sendCode(@Header("token") String token,
@Field("phoneNumber") String phoneNumber,
@Field("langCode") String langCode);
However, it is not working. When I log my request, it is showing that the request body is not correct. What is wrong with my code above?