【发布时间】:2023-03-29 02:30:02
【问题描述】:
我正在尝试在 java 中为我正在开发的 Android 应用程序发布一些 JSON 数据。下面是有效的还是我需要以不同的方式推送 JSON 字符串?
HttpPost httpost = new HttpPost("http://test.localhost");
httpost.setEntity(new StringEntity("{\"filters\":true}"));
httpost.setHeader("Accept", "application/json");
httpost.setHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
//... other java code to execute the apache httpclient
提前谢谢你
【问题讨论】:
标签: java android json httpclient http-post