I have:
InputStream input = null;
HttpURLConnection connection = null;
URL url = new URL("...");
connection = (HttpURLConnection) url.openConnection();
String zam = "...";
connection.setRequestProperty("Cookie",zam);
connection.connect();
int fileLength = connection.getContentLength();
input = connection.getInputStream();
byte data[] = new byte[400];
int count;
count = input.read(data);
connection.disconnect();
String str1 = new String(data);
str1, the response is always only:
!DOCTYPE HTML PUBLIC "-/
nothing more. But when I turn off the cookie:
connection.setRequestProperty("Cookie",zam);
everything is OK;
Thanks ind adv for reply. Adi.