How to send a JSON object over HttpClient Request with Android?

后端 未结 3 996
無奈伤痛
無奈伤痛 2020-12-16 14:39

I want to send the JSON text {} to a web service and read the response. How can I do this from android? What are the steps such as creating request object, setting content h

3条回答
  •  时光说笑
    2020-12-16 15:25

    I do this with

    httppost.setHeader("Content-type", "application/json");
    

    Also, the new HttpPost() takes the web service URL as argument.

提交回复
热议问题