【发布时间】:2015-03-22 12:29:01
【问题描述】:
我正在使用 HttpClient 库。而且我知道直接用 POST 请求发送 json 字符串的方式。喜欢:
HttpPost post = new HttpPost(url);
post.setEntity(new StringEntity(jsonString));
但是如何使用 GET 请求发送相同的数据。因为,在 HttpGet 类中没有像“setEntity(StringEntity entity)”这样的方法。 而且我愿意像使用 POST 请求一样发送没有任何特定密钥的数据。
【问题讨论】:
-
你想达到什么目的?显示代码示例。您不能使用 GET httpmethod 上传 json 字符串。
标签: android httpclient apache-httpclient-4.x