80,471
社区成员




HttpURLConnection connection = null;
try {
URL url1 = new URL("http://timg.baidu.com/timg?lbstsm&ref=http%3a%2f%2fbj.nuomi.com&quality=100&size=8&sec=1457499036&di=d4adbc6ca3db21cbf97c68f343198cc6&src=http://e.hiphotos.baidu.com/bainuo/crop=0,21,690,418;w=230;q=80/sign=4f0238455466d0166a56c468aa1bf835/a8773912b31bb0518ec008a0307adab44bede056.jpg");
connection = (HttpURLConnection) url1.openConnection();
connection.setRequestMethod("GET");
connection.setReadTimeout(20000);
connection.setConnectTimeout(20000);
int respondCode = connection.getResponseCode();
Log.v("code", respondCode + "");
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}