javascript如何https请求
在javascript中使用btoa()方法实现https请求,具体方法如下:
function b64EncodeUnicode(str) {
return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g,
function(match, p1) {
return String.fromCharCode('0x' + p1);
}));
}
相关问答
在javascript中使用btoa()方法实现https请求,具体方法如下:
function b64EncodeUnicode(str) {
return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g,
function(match, p1) {
return String.fromCharCode('0x' + p1);
}));
}
相关问答
扫码添加客服微信