search

Home  >  Q&A  >  body text

android - How to avoid urlencode when retrofit post data?

    @FormUrlEncoded
    @POST("abc/eft/ccc")
    Observable<BaseResponseBean> postURL(@Field(value="urlA", encoded=true) String urlA);

Regardless of encoded=true or encoded=false (default). The final result urlA passed up is converted by UrlEncode.

How can I post the original string directly?

I consulted some back-end personnel and said that under normal circumstances, post form data must require URLEncode. Otherwise, if there are & and the like, it is easy to have problems.
But mainland development is not so rigorous. We just require the original data to be transmitted.

漂亮男人漂亮男人2744 days ago768

reply all(2)I'll reply

  • 仅有的幸福

    仅有的幸福2017-05-16 13:33:06

    You can try it instead of using the form submission method and change it to json submission

    reply
    0
  • PHPz

    PHPz2017-05-16 13:33:06

    No method found. In the end, it can only be intercepted in the Interceptor and java.net.URLDecoder.decode("String to be decoded", "utf-8");

    reply
    0
  • Cancelreply