Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I try to receive a response from sending a http request in blackberry. It correctly open the Http Connector. But It can't receive the response. The code I used yo recieve the response is mentioned below.

Java
String url="https://www.google.lk/";
HttpConnection con = null;
InputStream is = null;

try {
    con = (HttpConnection) Connector.open(url);
    int responseCode = con.getResponseCode();
    Dialog.alert(String.valueOf(responseCode ));
   }
catch(Exception e)
{
	Dialog.alert(e.getMessage());
}


The code is not shown a alert as expected in the code. And also any exception is not occurred while running the application on Blackberry simulator. Is any error in above code?
Posted

1 solution

 
Share this answer
 
Comments
Wentworth Miller 11-Aug-12 11:41am    
Thanks Aditya. But this is not working properly

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900