-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ajax POST request from phonegap to server fails. i use phonegap 4.2.0-0.24.2. #274
Comments
Hi @pvin Try this comment from a similar thread: #169 (comment) |
hi @pvin , i dont know how to fix this, any help would make my day 😄 |
@santinobonora sorry i didn't try to fix.... |
@santinobonora |
@pvin i saw it earlier yes, this did not fix my issue. but many many thanks already |
@santinobonora In order to make a XHR/ajax request to your localhost, you will need to hard code it's public address. This is likely the same IP address reported by the |
My phonegap app was working just fine, till the moment I updated phonegap. Now, any changes that I make to the files don't refresh the app and none of the ajax requests work. I am running the app on localhost. It doesn't even print out console logs outside the ajax calls. All that is printed on terminal is sth like the following: [phonegap] 200 /socket.io/?EIO=2&transport=polling |
When I compared my updated project to the one that has the older version of phonegap (on GIT), I noticed that the older version contains .cordova folder whereas the new one doesn't. |
helle @eveli050 i have solved my problem with placing my webservice into a server. this solved the problem. localhost is not reachable anymore @mwbrooks to the ip adress did not work for me eighter.. thank you anyhow for helping me! like i said make a call to a server .. this could solve the problem for you. |
@santinobonora many thanks |
Originally started a thread at phonegap/phonegap-app-desktop#375 but now convinced it's a Phonegap Developer issue rather than Desktop and found this related thread. The problem appears to have started with one of the v1.5.x releases.
I have checked the IIS Express log files for the server side and the request does not appear to be getting as far as that when made from v1.5.x. The response returned by Phonegap Desktop log is showing:
When hitting live URLs (e.g. |
Hey @theogray, Thanks for the detail and your analysis! The latest version of the PhoneGap Developer App runs on the file protocol and should by-pass single origin security policy (CORS). It's concerning that the IIS Express server logs do not show the incoming request. In your previous thread, you mentioned that it is binding to A quick test to see if things should work would be take another computer on the same network as the IIS Express box. Open a desktop browser and try to ping the end-point (e.g. |
Thanks @mwbrooks, I've found the info you mean for IIS Express. Having tried that out I can see what the difference between v1.4.0 and v1.5.x is, as I also had to open the It looks like there has been a fundamental change to PhoneGap Developer since v1.4.0 - where before all requests (or at least those to This is a problem as the proxying made the dev environment very simple to setup - each dev runs everything locally without needing admin privileges and the only port that needed to be open on each dev machine firewall was 3000. Also all Has this proxying been removed for a reason, or just been lost due to a different change? In a dev environment it makes a lot of sense to run things with all traffic going via PhoneGap Desktop, although for testing purposes I can understand that sending requests directly from the device may be preferable to some. Is this a feature that could be added back in and then controlled via a setting on the device or in |
hi, to solve the issue..try to use this $.get(url,callback); }); }); |
Ajax POST request from phonegap to server fails. any idea to solve? or any other way to workaround?
i use phonegap 4.2.0-0.24.2.
The text was updated successfully, but these errors were encountered: