android 发送json 到服务器
来源:互联网 发布:java怎么查询数据库 编辑:程序博客网 时间:2024/05/18 13:25
试试看发送json到服务器上:
Reader r;
String url = "http://10.111.111.43:9000/XentivoCrm/services/VisitJSON";
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost httpost = new HttpPost(url);
InputStream data = null;
try {
ObjectMapper mapper = new ObjectMapper();
mapper.getSerializationConfig().setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
String json = mapper.writeValueAsString(mStringArray);
//I used jackson to create json, but built-in json.org will work
StringEntity se = new StringEntity(json);
httpost.setEntity(se);
httpost.setHeader("json", "application/json");
httpost.setHeader(HTTP.CONTENT_TYPE, "application/json");
HttpResponse response = httpClient.execute(httpost);
}
Reader r;
String url = "http://10.111.111.43:9000/XentivoCrm/services/VisitJSON";
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost httpost = new HttpPost(url);
InputStream data = null;
try {
ObjectMapper mapper = new ObjectMapper();
mapper.getSerializationConfig().setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
String json = mapper.writeValueAsString(mStringArray);
//I used jackson to create json, but built-in json.org will work
StringEntity se = new StringEntity(json);
httpost.setEntity(se);
httpost.setHeader("json", "application/json");
httpost.setHeader(HTTP.CONTENT_TYPE, "application/json");
HttpResponse response = httpClient.execute(httpost);
}
- android 发送json 到服务器
- android 发送json 到服务器
- Android利用JSON发送数据到服务器
- Android利用JSON发送数据到服务器
- Android利用JSON发送数据到服务器
- 发送JSON数据到服务器
- android发送json数据到服务器(框)
- android 发送json 到服务器 spring 怎么接收?
- Android 图片发送到服务器
- 【Android实战】----Android Retrofit2.1.0直接发送Json字符串到服务器
- http 发送json到服务器,服务器处理之后返回结果
- Android使用JSON想服务器发送数据
- android发送json数据到服务端
- Android利用HttpClient发送Json到后台
- Android 发送json数据到servlet
- 使用urlconnection和json发送post请求到服务器
- 转贴:使用urlconnection和json发送post请求到服务器
- 使用urlconnection和json发送post请求到服务器
- IR-drop Antenna 与EM的基本知识
- Windows 系统出问题及解决方案 记录
- Android 动态加载布局
- 秋雨寄相思
- ios公司开发者账号申请分享攻略
- android 发送json 到服务器
- .Net企业级应用架构设计之数据访问层
- 在友元中访问类的隐藏信息
- WebElement.clear() 方法的具体实现
- 从工具的奴隶到工具的主人
- System.BadImageFormatException:
- ICC小Tips集锦
- ASLR保护启用了吗
- 在VS2008环境编译C程序