I am retrieving data from restful web service in XML format, but unfortunately my String is null. Please help me, where is the problem in my code?
Here is the example code:
URL url = new URL("http://loxvo.fogbugz.com/api.asp?cmd=logon&email=myemail&password=mypwd");
HttpURLConnection request1 = (HttpURLConnection) url.openConnection();
request1.setRequestMethod("GET");
request1.connect();
InputStream is = request1.getInputStream();
BufferedReader bf_reader = new BufferedReader(new InputStreamReader(is));
String responseData = IOUtils.toString(bf_reader);
System.out.print(responseData);
I have tried this url in rest client: it's returning me correct xml, but here my String is null.