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

前端 未结 5 1366
时光说笑
时光说笑 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:20

    Send Authentication header with json Body to API sample code in Kotlin :

     @POST("/api/user/sendlist/")
        fun callSendJsonListPost(
                          @Header("Authheader") header: String,
                          @Body list: StringBuilder
                          )
            : Observable
    

提交回复
热议问题