I have an Android app which makes an http GET call. The code is pretty simple:
URL url = new URL(sUrl);
URLConnection urlc = url.openConnection();
InputStream is = urlc.getInputStream();
BufferedReader in = new BufferedReader(new InputStreamReader(is));
while ((str = in.readLine()) != null) {
buff.append(str);
}
// do stuff with the data
Recently the call has stopped working, and I get a 301 Moved Permanently response. However the call works perfectly well from a browser.
What would cause this? Is it a deliberate attempt to reject my request? Is there anything I can change to get around this?