tongwen
java 调用 api 返回错误?String generalUrl="https://api.weixin.qq.com/tcb/databaseadd?access_token="+tocken; try { URL url = new URL(generalUrl); conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("POST"); conn.setDoOutput(true); conn.setDoInput(true); conn.setUseCaches(false); conn.setRequestProperty("Connection", "Keep-Alive"); conn.setRequestProperty("Charset", "UTF-8"); conn.setRequestProperty("Content-Type", "application/json"); conn.setRequestProperty("accept","application/json"); ccs="{\"env\": \"clound-zygj\",\"query\": \"db.collection(\"zg_gzb\").add({data: [{\"employeenumber\":\"Z01117\"}]})\"}"; System.out.println(ccs); byte[] writebytes = ccs.getBytes(); conn.setRequestProperty("Content-Length", String.valueOf(writebytes.length)); OutputStream outwritestream = conn.getOutputStream(); outwritestream.write(writebytes); outwritestream.flush(); outwritestream.close(); if (200 == conn.getResponseCode()){ is = conn.getInputStream(); br = new BufferedReader(new InputStreamReader(is, "UTF-8")); String line; while ((line = br.readLine()) != null){ result.append(line); } }else{ System.out.println("ResponseCode is an error code:" + conn.getResponseCode()); } }catch (MalformedURLException e){ e.printStackTrace(); }catch (IOException e){ e.printStackTrace(); }catch (Exception e){ e.printStackTrace(); }finally { try{ if(br != null){ br.close(); } if(is != null){ is.close(); } }catch (IOException ioe){ ioe.printStackTrace(); } conn.disconnect(); } System.out.println(result.toString()); {"errcode":47001,"errmsg":"data format error hint: [5eLBH.wgE-hUGbXa]"},语句在开发控制平台测试没有问题。不知哪一步错误?
2020-04-24同求
请大神帮忙微信小游戏分包加载的流程图不分包的小游戏加载流程是: 下载游戏主包->加载game.js->运行游戏脚本->加载远程资源->启动首场景 分包是在流程的哪个位置呢? 大神帮忙画一张微信小游戏分包加载的流程图, 分包是在加载game.js后还是加载前就开始下载的, 用户界面可以看到分包下载的过程吗?
2020-04-24同问
有大佬知道Cocos构建的项目导入到微信开发者工具可以使用云开发操作数据库吗?我有个Cocos构建的项目,用微信开发者工具导入后没有云开发,想问下要怎么设置才可以呢
2020-04-24同问
个人发布微信小程序,需要认证吗?个人发布小程序,需要认证吗?答题小程序,阿里云服务器
2020-04-24一楼
小程序用户反馈可以有个通知提醒吗?今天主动看了下用户反馈才发现有用户在6天前就提交了反馈信息,怎样才能方便地查看用户反馈?
2020-04-23