简体   繁体   中英

Ajax request gets 500 (Internal Server Error) on cordova

I have an ajax request, when I make the request in the browser it works fine, when i make it inside cordova apk, I get internal error, I've look into both headers, the only diference is in the ORIGIN;

This is the one not working, with origin:file://

POST http://XXX:50000/RESTAdapter/s4p/mobile/login 500 (Internal Server Error)

Accept:application/json, text/javascript, */*; q=0.01 Accept-Encoding:gzip, deflate Accept-Language:en-US Connection:keep-alive Content-Length:59 Content-Type:application/json Cookie:saplb_*=(J2EE9465620)9465650 Host:------- Origin:file:// User-Agent:Mozilla/5.0 (Linux; Android 7.0; Android SDK built for x86 Build/NYC; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/51.0.2704.90 Mobile Safari/537.36 X-DevTools-Emulate-Network-Conditions-Client-Id:364FC1A3-AE91-465B-821A-9EA13D731E5E X-Requested-With:io.cordova.hellocordova

Your AJAX request arrives to the server and you get an error there, on your server. Due to the error, the response is a 500 . If you know that this works in some cases and does not work in other cases, then check the differences between the different requests and see what is the stack trace of the error. When you have done that, you will know what the problem is. And from there on, you will be in an infinitely better position than now to fix the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM