Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

CordovaHTTP plugin error basicAuth

$
0
0

@jffs wrote:

Hi!, i'm work in a ionic project using cordovaHTTP plugin. The fact is i need to authenticate a server after to make request. when i call the method "useBasicAuth" this error was displayed

TypeError: Cannot set property 'Authorization' of undefined
    at Object.http.useBasicAuth (file:///android_asset/www/plugins/cordova-plugin-http/www/cordovaHTTP.js:36:36)

This method on cordovaHTTP :

 useBasicAuth: function(username, password) {
        this.headers.Authorization = 'Basic ' + b64EncodeUnicode(username + ':' + password);
    },

It's seems like the object "this.headers" is null... any solution?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>