Closed Seeroy closed 1 year ago
Is the URL publicly available? Would you please share the URL?
I cant send URL, because without access_token parameter URL is not accessible. I can send the response of the URL.
response.zip Here is a sample response from an VK API. Sensetive data removed
Thanks for providing this data, but I'll need to debug the code which is not possible with the JSON repsonse only. Did you try to debug it on your side and find out in which line exactly it is throwing?
Oh and you should also try to replace the content of the success callback:
cordova.plugin.http.sendRequest(url, options, function (response) {
// comment this line
// callback(response);
// and just log the response to the console
console.log(response);
}, function (response) {
console.log("HTTP ERROR");
console.log(response);
});
Is it still throwing?
Its throwing only, if im trying to decode JSON using JSON.parse() This code throwing error too
cordova.plugin.http.sendRequest(url, options, function (response) {
console.log(JSON.parse(response));
}, function (response) {
console.log("HTTP ERROR");
console.log(response);
});
Okay then, I guess your problem is not related to this plugin in this case. You are receiving invalid JSON data from your endpoint which can't be parsed.
Closing this, feel free to open a new issue, if this won't solve your problem! 👍
Describe the bug Trying to get json with GET request from VK API. Error: "advanced-http: an error occured during post processing response: Cannot read properties of undefined (reading '0')"
System info
Minimum viable code to reproduce If applicable, add formatted sample coding to help explain your problem.