HttpConnection returns null

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");

before calling connector.open

Thnx

[947 byte] By [lekkie.aydota] at [2007-11-26 18:27:30]
# 1
is it possible to retrieve the message that is sent when an httpURL connection return a response codes other than 200?I know it throws an ioe exception when a response other than 200 is returned, is there a way to retrieve the message returned by a servlet with response code 401?
lekkie.aydota at 2007-7-9 6:01:37 > top of Java-index,Core,Core APIs...