私のアプリケーションでは、XML応答を返す1つのAPIにアクセスしようとしています。問題は、APIから応答コードを取得していることですが、WebブラウザーでAPIを直接実行すると、XML応答を取得しています。サーバー側または私のコードで。助けてください。
これが私のコードです:
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();
}
前もって感謝します。