Tag:retrofitandroid
Article From:https://segmentfault.com/q/1010000012149107
Question:

I found it similarpostmanInsideform-dataandx-www-form-urlencodedThere is a corresponding annotation@Part and@Field But correspondingrawNo?
How to use it?

Answer 0:

This defines the parameters of the interface request

The return value method name (@Body RequestBody test)

Then invoke the previously defined method, and the parameters are passed down.

RequestBody.create(MediaType.parse("text/plain"), Here is the string content you want to pass.)

That’s the same as postman’s raw

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *