* @Descriptionmap 将图片文件转化为字节数组字符串,并对其进行Base64编码处理 * @author * @Date * @param path 图片路径 * @return */ public static String imageToBase64(String path) {// 将图片文件转化为字节数组字符串,并对其进行Base64编码处理 byte[] data = null; // 读取图片字节数组 try {...
get请求 下面实现https的请求,获取图片,然后转成base64字节码 this.checkCodeUrl ='https://www.test.com/kaptcha.jsp';varhttps = require('https'); https.get(this.checkCodeUrl,function(res){vardatas =[];varsize =0; res.on('data', function(data){ datas.push(data); size+=data.length; })...
下面实现https的请求,获取图片,然后转成base64字节码 this.checkCodeUrl ='https://www.test.com/kaptcha.jsp';varhttps = require('https'); https.get(this.checkCodeUrl,function(res){vardatas =[];varsize =0; res.on('data', function(data){ datas.push(data); size+=data.length; }) res.on...