这是什么意思啊?

WANG_one_1 2017-06-06 02:36:53
public static String sendJSON(String url, JSONObject obj) {
String result = null;
try {
HttpClient client = new DefaultHttpClient();
HttpPost request = new HttpPost(url);
StringEntity entity = new StringEntity(obj.toString());
request.setEntity(entity);
Log.e(TAG, "request is " + obj.toString());
HttpResponse response = client.execute(request);
Log.e(TAG, "response code="
+ response.getStatusLine().getStatusCode());
if (response.getStatusLine().getStatusCode() == 200) {
result = EntityUtils.toString(response.getEntity());
Log.e(TAG, "reponse is " + result);
return result;
...全文
441 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
ckc 2017-06-08
  • 打赏
  • 举报
回复
sendJSON 看到这个简直就已经知道这个函数是发送json到一个url用的了

1,265

社区成员

发帖
与我相关
我的任务
社区描述
软件工程/管理 管理版
社区管理员
  • 研发管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧