In my application i am trying to access 1 API which will return XML response.Now the problem is i am getting the response code from API ,but when i run the API straightly in web browser i am getting XML response.Whether the problem is in server side or in my code.Please help me.
Here is my code:
try{
// System.out.println("b4 conn");
HttpConnection conn = (HttpConnection)Connector.open(rssUrl);
conn.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
System.out.println("after conn="+conn.getResponseCode()); ---------->I am not getting the response here(so going to catch and closing the application).
if(conn.getResponseCode()==HttpConnection.HTTP_OK)
{
Some stuff goes here.
}
catch(Exception ex){
// System.out.println("Error = "+ex);
m.DisplayCloseAsk();
}
Thanks in advance.