开发者社区 问答 正文

关于android json 数据 传给 服务器 的问题

这样的JSON 字符串 传给服务器 怎么弄 , 不会拼 啊 。 跪求 大神 解答。。

{
 "comment":
 { 
    "content": "测试",
    "contentId": "31"
},
"username":"helloworld",             
"category":{
    "id":"11"
}


}

展开
收起
爵霸 2016-03-12 09:05:29 2037 分享 版权
1 条回答
写回答
取消 提交回答
  • 直接传json格式的字符串就可以,把请求头设置成json如:response.setContentType("text/json; charset=UTF-8");

    2019-07-17 19:00:01
    赞同 展开评论