I do not know if this is a bug but it looks like, it only happens when using app.request with GET method… if using POST method there is no error at all…
My request using GET method
app.request({
headers: {
'Content-Type': ["application/json", "text/plain"],
'Accept': 'application/json',
'Accept-Encoding': 'gzip;q=1.0, compress;q=0.5',
'authority': 'testeapp.com'
},
url: ' https://myurl',
timeout: 0,
method: 'GET',
data: {
"customer": "123212"
},
beforeSend: function() {
console.log('beforeSend');
},
complete: function() {
console.log('complete');
},
success: function(results) {
console.log('success');
console.log(results);
app.data.myResults = results;
setTimeout(function() {
app.preloader.hide();
resolve({
component: GotoPage
}, {
context: {}
});
}, 500);
},
error: function(xhr, textStatus, errorThrown) {
app.preloader.hide();
console.log(JSON.stringify(xhr));
app.dialog.alert('Error: ' + textStatus + errorThrown);
}
});
I have test my GET request with postman and works perfectly but not in framework7
the error I receive when using GET method:
Error:
{"_context":{"delegate":{},"requestHeaders":{"content-type":"application/json,text/plain","accept":"application/json","accept-encoding":"gzip;q=1.0, compress;q=0.5","authority":"testeapp.com","x-requested-with":"XMLHttpRequest"},"responseHeaders":{},"listeners":{},"readyState":4,"responseType":"text","withCredentials":false,"upload":{"_context":{"listeners":{}}},"status":0,"method":"GET","url":" https://myurl?customer=123212","async":true,"user":"","password":"","response":"","responseText":"","responseURL":"","statusText":""},"requestUrl":" https://myurl?customer= 123212","requestParameters":{"url":" https://myurl?customer= 123212","method":"GET","data":{"customer":"123212"},"async":true,"cache":true,"user":"","password":"","headers":{"Content-Type":["application/json","text/plain"],"Accept":"application/json","Accept-Encoding":"gzip;q=1.0, compress;q=0.5","authority":"apptest.com"},"xhrFields":{},"statusCode":{},"processData":true,"dataType":"text","contentType":"application/x-www-form-urlencoded","timeout":0,"crossDomain":false}}
Any ideas where this error comes from and how to fix GET methods when using app.request?
if I use XMLHttpRequest() it works but with app.request GET method it gives me that error above all the time!
thanks for any advice or tips!