Hi All,
i am making http connection using
URL urlToConnect = new URL ("http://www.xyz.com");
HttpURLConnection connection = ( HttpURLConnection ) urlToConnect.openConnection();
I need to set the following property ,i am doing it like
connection.setRequestMethod("POST");
connection.setDoOutput(true);
connection.setRequestProperty("user-agent", USER_AGENT);
connection.setRequestProperty("Content-Type", "application/xml");
connection.setRequestProperty("Accept", "application/xml");
connection.setRequestProperty("http_code", "200");
connection.setRequestProperty("USERNAME", "test");
connection.setRequestProperty("PASSWORD", "test");
Is it the right way to set all these data?