ionic-framework - 如何使用 inappbrowser ionic 4 发送帖子数据
问题描述
我需要知道如何通过邮寄方式将数据发送到作为支付网关inappbrowser
的外部url
我正在处理ionic
执行脚本的属性但是我没有设法传递发布数据,我想看看是否有其他方法但我需要使用inappbrowser
let options: InAppBrowserOptions={
zoom:'no',clearcache:'yes',hidden:'yes',hidenavigationbuttons:'yes',hideurlbar:'yes'
};
let customheader= 'foo:123,bar:456';
const browser= this.iab.create('https://url_anyway','_blank',options);
browser.on('loadstop').subscribe( (ev: InAppBrowserEvent) => {
browser.executeScript({code: "(function() {const data = new FormData(document.getElementById('mp_account'));fetch('https://url_anyway', { method: 'POST', body: data}).then(function(response) { if(response.ok) { return response.text() } else { throw 'Error en la llamada Ajax';}}).then(function(texto) { console.log(texto);}).catch(function(err) { console.log(err);}); })()"}).then( function(){
setTimeout(function(){
browser.show();
;}, 1500);
});
});
通过 post 方法打开 url 时不显示任何内容
解决方案
推荐阅读
- python - 失去健康之间的延迟
- python - 在 Python 中仅使用 matplotlib 实现 R 的 geom_count()
- python - 如何在 TF 图中端到端训练 TensorFlow 模型之前预处理特征
- javascript - TypeError:无法在“节点”上执行“removeChild”:参数 1 不是“节点”类型
- docusignapi - Docusign - 外部应用程序的管理员同意。未能获得管理员同意的 oauth 令牌
- c++ - 向量堆栈对 | 使用 dfs 在树中的最长路径
- ios - 如何将文本输入从字符串转换为浮点数
- c# - 比较 2 个散列字节数组
- dji-sdk - 检测板载 SDK 中的 RTH(返回首页)
- powershell - 用于打印文件的 Powershell 进度条