Having trouble again, sorry guys..
Code:
HttpConnection conn = null;
Code:
{
System.out.println("try");
conn = null;
conn = (HttpConnection)Connector.open(URL);
conn.setRequestMethod(HttpConnection.POST);
conn.setRequestProperty("User-Agent", "BlackBerry/3.2.1");
String lang = conn.getRequestProperty("Content-Language");
System.out.println("set");
InputStream in = conn.openInputStream();
System.out.println("e0");
byte[] data = new byte[256];
System.out.println("e1");
int len = 0;
System.out.println("e2");
StringBuffer raw = new StringBuffer();
System.out.println("bw");
while (-1 != (len = in.read(data)) )
{
raw.append(new String(data, 0, len));
}
String text = raw.toString();
System.out.println(text);
}
catch (IOException e)
{System.out.println("catch");
System.err.println(e.toString());
} It gets to display "try" and "set" but not "e0". so it's getting stuck at conn.openInputStream() for some reason.
I just tried to output the value stored in "lang" and got a "null". Does that mean that the application isn't setting up conn properly? What am i doing wrong? About to go crazy here
