收藏
回答

请帮忙看看as3调用小程序数据库数据,提示“47001”POST BODY 格式错误?谢谢!

场景:用flash as3开发一个桌面程序,需要获取微信小程序数据库里的数据。下面是我参考腾讯云的博客编写的

参考:https://cloud.tencent.com/developer/article/1568906?from=15425

问题:提示,{"errcode":47001,"errmsg":"data format error rid: 62392f1f-5b261480-12ce3548"},POST BODY 格式错误。请问要这个post的数据要怎么提交呢?感谢

var access_token:String="55_VQG-mI4yP0XwUMauyeWUuS2ZvWKb3geKQL2Fr1PHUIsJVUFZS5YYhc9PTOrrBOWei_AJPnSQ2MJkkQRzRx6WSeJ9YYOCe3HKQpMveA8OtDMW-jSgmXFiP31Sv70YIRCqBPNRB1GnYD0nxFWbRKDaAEAEXQ";
var myVars:URLVariables = new URLVariables();
myVars.access_token = access_token
myVars.env = '这里我填写正确';
myVars.query = "db.collection(\'nantang\').where({done:true}).limit(10).skip(1).get()";
			
var request:URLRequest = new URLRequest("https://api.weixin.qq.com/tcb/databasequery?");
request.method = URLRequestMethod.POST;

//request.data = {
	//"access_token": access_token,
	//"env": "这里我填写正确",
	//"query": "db.collection(\'nantang\').where({done:true}).limit(10).skip(1).get()"
//};

request.data = myVars;
//request.data = obj;
			
//创建URLLoader对象
var loader:URLLoader = new URLLoader(request);
//设置接收数据方式
//loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, loadedHd);
loader.load(request);
回答关注问题邀请回答
收藏
登录 后发表内容