I am using retrofit to make a post api call, I am getting the following error while trying to hit the endpoint.
Caused by: rx.exceptions.OnErrorNotImple
I solved this issue by replacing @Query to @Field, here is how:
Not working code:
@POST("/my/url/path")
Result postToServer(
@Query("user_name") String userName);
Working example:
@FormUrlEncoded
@POST("/my/url/path")
Result postToServer(
@Field("user_name") String userName);
For methods that do not have any fields I had to add empty string like below
Result postToServer(@Path("my_path") String myPath,
@Body String emptyString);
And call it passing "":
restClient.postToServer(myPath, "");