请教http.request传字节数组的正确方式
已存档
看开发文档http.request是可以传输字节数组的,options里body可以指定字节数组
我打算把截图区域不保存文件,直接以字节数组的方式发送到后端接口
var res = http.request(url,{ method:"POST", contentType:"application/octet-stream", body:images.toBytes(clip, format = "jpeg"), });
结果hamibot报错:
13:54:19.895/E: TypeError: writeTo is not a function, it is object. (file:///android_asset/modules/__http__.js#49) TypeError: writeTo is not a function, it is object. at file:///android_asset/modules/__http__.js:49:0 at 6427a9d72e14e0bb3dcb2cc7.js:22:0
请教高手有何解法