silkimen / cordova-plugin-advanced-http

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

[Bug] [Chrome] JSON parses with additional backslashes in properties thus unable to read #457

Closed Cronatsu closed 2 years ago

Cronatsu commented 2 years ago

Describe the bug When viewing JSON file console print out in Chrome browser, sub properties of "data" property have backslashes in their names, backslashes count as unexpected tokens when attempting to run Cordova app so unable to run if attempting to read sub properties by name.

System info

Are you using ionic-native-wrapper? No

Minimum viable code to reproduce If applicable, add formatted sample coding to help explain your problem.

e.g.:

cordova.plugin.http.get(
    'http://IP/couchdb/_all_docs',
    {responseType: 'json'},
    {Authorization: 'Basic key'},
    function(response) {
        console.log(JSON.stringify(response));
    },
    function(response) {
        navigator.notification.alert(
        response.status + response.error,
        null,
        'Try Again',
        ['Okay']
        );
    });

Screenshots If applicable, add screenshots to help explain your problem.