search

Home  >  Q&A  >  body text

android Retrofit 的post请求方式的参数用换成json么。

今天初步研究了Retrofit 框架,我们公司要求全部必须是以POST请求,所以我想问一下传参试需要转换成json么?
怎么转,求助大神!

巴扎黑巴扎黑2888 days ago426

reply all(1)I'll reply

  • 黄舟

    黄舟2017-04-17 17:44:34

    I don’t understand your question. What does your backend receive and what do you upload? If you want to know how to use retrofit post String, see how retrofit 2.0 posts requests and passes json parameters

    If you want to ask if you can add a question mark and parameters after the URL, that is, in the form of xxxxx.com?username=taobao&password=jingdong, it seems that it is possible. I remember that the servlet I wrote before can be received, but I have to ask your backend for details. Because the post request information is usually placed in the request body (it seems to be this name...), which is different from the request header

    reply
    0
  • Cancelreply