Retrofit - @Body parameters cannot be used with form or multi-part encoding

前端 未结 5 1360
时光说笑
时光说笑 2020-12-24 05:10

I m trying to make a request in which I want to include a Header , a form-urlencoded field and a json body. My Retrofit interface is as follows

@FormUrlEnc         


        
5条回答
  •  南方客
    南方客 (楼主)
    2020-12-24 05:24

    I solved this problem by adding the field into

    @POST("/api/register") 
    

    like this:

    @POST("/api/register?grantType=value")
    

    it's not a good solution, but may be useful.

提交回复
热议问题