How to make a POST request using retrofit 2?

后端 未结 2 832
离开以前
离开以前 2021-01-17 11:41

I was only able to run the hello world example (GithubService) from the docs.

The problem is when I run my code, I get the following Error, inside of onFail

2条回答
  •  无人共我
    2021-01-17 12:18

    If you don't want JSON encoded params use this:

    @FormUrlEncoded
    @POST("/")
    Call request(@Field("api_key") String apiKey, @Field("app_id") String appId);
    

提交回复
热议问题