Android URLConnection GET query works WiFi but different response 3G

Posted by kisplit on Stack Overflow See other posts from Stack Overflow or by kisplit
Published on 2010-12-28T19:16:19Z Indexed on 2010/12/28 20:53 UTC
Read the original article Hit count: 211

Filed under:
|
|
|

Hey, I have some code which queries a web server using HTTP GET

URLConnection connection = new URL("www.example.com" + "?blah=ok").openConnection();
connection.setRequestProperty("Accept-Charset", "UTF-8");
InputStream http_response = connection.getInputStream();

Now when I run this code while connected to WiFi I get the expected response but when I run this with WiFi disabled I instead seem to get the response of www.example.com without the appended query.

Does anyone know why this is happening?

© Stack Overflow or respective owner

Related posts about android

Related posts about 3g