Answer the question
In order to leave comments, you need to log in
Retrofit, what do these annotation options do?
1) @Field annotation which has value and encoded parameters, I can't figure out how it works. I can send pojo to the test site, pojo consists of 4 fields, body, id, title, userId, but using this annotation, I can send from 1 to 4 fields and the response from the server will be positive, why? How does encoded = true work? I set it to true and see no difference from the answer.
@FormUrlEncoded
@POST("/posts")
fun post(@Field("title",encoded = true) title:String):Call<ResponseBody>
Answer the question
In order to leave comments, you need to log in
Why does the server respond to a request that, as I understand it, you consider incorrect, the question is for the creator of the server, here you will not be answered.
Encoded is needed to % encode data that cannot be part of the URI.
Apparently, there are situations when you want to go to URIs with different hosts / schemes through one retrofit service. If you don't need it, just don't use it. It will take - remember and zayuzayesh.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question