第三方平台代小程序上传代码的ext_json需要怎么写?
我在做第三方代小程序上传代码的功能时,需要post这些参数:
其中的ext_json,我自己按文档试了多种情况,都不好使,看了社区中阳阳的帖子后,按他的思路把数据设置为这样:
JSONObject jsonObject1 = new JSONObject();jsonObject1.put("shopId", 20);JSONObject jsonObject2 = new JSONObject();JSONObject jsonObject3 = new JSONObject();jsonObject3.put("navigationBarTitleText", "logs"); JSONObject jsonObject4 = new JSONObject();jsonObject4.put("pages/logs/logs", jsonObject3.toString()); jsonObject2.put("ext", jsonObject1.toString());jsonObject2.put("extAppid", "wx8cac0600849c3264");
|
然后再放入一个父级json里:
jsonObject.put("template_id", Integer.parseInt(template_id));jsonObject.put("ext_json", jsonObject2.toString());jsonObject.put("user_version", user_version);jsonObject.put("user_desc", user_desc); |
最终传入的数据是这样的:
{“ext_json”:“{\“extAppid\”:\“wx8cac0600849c3264\”,\“extPages\”:{\“pages/logs/logs\”:\”{\\\“navigationBarTitleText\\\”:\\\“logs\\\”}\“},\“ext\”:\”{\\\“myId\\\”:20}\“}”,“user_version”:“1.13”,“user_desc”:“美图”,“template_id”:1}
但是返回的结果是:
{“errcode”:47001,“errmsg”:“data format error hint: [0352e622]”}
求好心人解答。。。这是什么问题,是ext_json的格式有问题吗?还是其他的什么问题,纠结快两天了!!
