I am trying to make http call from Mobile application. I am solving Exercise 5 in , where we make http call.
After clicking on ‘Login’, I am getting pop up with ‘A Network error has occurred’ and connection response I am getting as ‘404’.
But if I change the url to ‘http://google.com’ I am getting below pop-up with connection response as 200.
Any Idea why I am getting 404 for ‘http://www.bedrockdev.com/tutorials/nuiexercise/submit_cols.php’ url ?
Can you reach it from your standard browser? I just tried the NativeUIExercise app here and it seems to be working okay.
Yes, I can reach it from my browser.
It’s odd that you can reach it from your browser, but you’re getting a 404 from your mobile app.
Are you sure it’s a 404 status (page not found)?
Can you confirm the URL is right in the code of your app?
You could always use tcptrace.exe (http://www.pocketsoap.com/tcpTrace/tcpTrace081.zip) and route through this so that you can see the request and response, i.e.
This might give you more of a clue as to what is going wrong.
Also, have you tried the same classic steps as you would from a PC? Try hitting Google, Amazon or another common server that you know? Try using the direct IP address rather than relying on DNS? Also, try hitting the URL through the browser on your device?
Thanks a lot for your response. But below are my findings:-
I deployed Exercise 5 to Android emulator and as well as on my Android based Samsung mobile phone. Everything worked fine.
When I ran it with Phoney then it gave me 404 error code. I used 'TCPMon' to route my requests and it worked fine then. (I have no idea why this is happening?)