大佬教程收集整理的这篇文章主要介绍了android – Retrofit-2.0 – 在xml中使用json的解析响应,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
{"loginid":"10051"}
示例回复:
<@R_674_10495@ng xmlns="http://www.example.com/">{"user":"user1","class":"1"}</@R_674_10495@ng>
所以,
我想从响应中获取json part {“user”:“user1”,“class”:“1”}.
我试着写自定义转换器.但由于我是Retrofit 2.0的新手,无法写作.
提前致谢
一些接口用于接收requestBody作为响应:
@POST("/exampleRout") Call<JsonElement> foo(@Body requestBody requestBody);
响应:
public void onResponse(Call<JsonElement> call,Response<JsonElement> responsE) { JsonElement jsonElement = response.body(); @R_674_10495@ng yourResponse@R_674_10495@ng = jsonElement.to@R_674_10495@ng(); //parse it with regEx or XML parser and etc }
以上是大佬教程为你收集整理的android – Retrofit-2.0 – 在xml中使用json的解析响应全部内容,希望文章能够帮你解决android – Retrofit-2.0 – 在xml中使用json的解析响应所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。