首页 > 解决方案 > 类型“HTTP”上不存在属性“setServerTrustMode”。(插件-高级-HTTP)

问题描述

我正在尝试在此 pugin cordova-plugin-advanced-http 中使用“setServerTrustMode”,但出现错误Property 'setServerTrustMode' does not exist on type 'HTTP'.

我正在使用“cordova-plugin-advanced-http”:“^2.4.0”和“@ionic-native/http”:“^4.20.0”,

我已经尝试从构造函数中删除“http”但仍然无法正常工作。

这是我的代码

import { HTTP } from '@ionic-native/http';

constructor(private http: HTTP)
{}

public test(){

        this.http.setServerTrustMode('nocheck', function () {
           console.log('success!');
       }, function () {
           console.log('error :(');
       });
}

如何解决这个问题?

标签: httpionic3

解决方案


我也有同样的问题。看看这个

似乎 ionic-native 没有插件的最新版本。

我正在尝试安装没有离子原生包装器的插件。


推荐阅读