I was trying to open a page and read from the stream.
Actually, the page returns different type os response. When a transactionis succesful it returns 200 if the transaction has some problems it sends dsome other response code (other than 200).
I want to be able to read the stream (content of the stream) even though the response code is not 200. I discovered if I open the url with the URL library or, once the response code is not 200, it closes the stream, hence any attempt to read it throws exception
However, I tried opening the stream from with httpconnection HttpConnection conn = (HttpConnection) Connector.open(req,Connector.READ,true);
but conn returns null.
why is that.
I am behind a proxy, so I set the system property: System.setProperty("http.proxyHost","172.16.10.2"); System.setProperty("http.proxyPort","8080");
or are you giving us some red herrings? There's no Connector class in the J2SE and HttpConnection doesn't have an open method. I suggest you tell the details because the better question you ask, the better answer we can give.