Try simply passing the InputStream of the request directly to IOUtils.toString (), because IOUtils.toString does the buffering on its own.
request1.getResponseCode(),
- Http.
, connect(),
getInputStream().
: 302. , . :
try {
URL url = new URL("http://loxvo.fogbugz.com/api.asp?cmd=logon&email=myemail& password=mypwd");
HttpURLConnection request1 = (HttpURLConnection) url.openConnection();
request1.setRequestMethod("GET");
String code = String.valueOf(request1.getResponseCode());
System.out.println("Error code "+code);
InputStream is = request1.getInputStream();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(is));
String line;
while ((line = bufferedReader.readLine()) != null) {
System.out.println(line);
}
} catch (Exception e) {
e.printStackTrace();
}