wymsee / cordova-HTTP

Cordova / Phonegap plugin for communicating with HTTP servers. Allows for SSL pinning!
MIT License
372 stars 301 forks source link

Getting empty error response on get request #116

Open mourice opened 7 years ago

mourice commented 7 years ago

Using The below code giving the empty error response. Using it in ionic2

window.cordovaHTTP.acceptAllCerts(true, function () {
            window.cordovaHTTP.get(ServiceHelper.GetUserGuideUrl(),{},{'Content-Type':'application/json','X-ClientVersion': ServiceHelper.ClientVersion,'X-Source': ServiceHelper.Source,'X-User': GlobalVars.getUserSession().userName, 'X-Locale': ServiceHelper.Locale}, function (response) {
                console.log("success");
            }, function (response) {
                console.log("error");
            });

        }, function () {
            console.log('error :(');
        });

Not getting any hint on whats wrong in the request. Please help

djezzzl commented 7 years ago

You forget to write it in console function (response) { console.log("error"); }); should be function (response) { console.log("error", response); });