- try {
- HttpGet httpGet = new HttpGet(url);
- HttpResponse httpResponse = new DefaultHttpClient()
- .execute(httpGet);
- if (httpResponse.getStatusLine().getStatusCode() == 200) {
- return true;
- } else {
- return false;
- }
- } catch (Exception e) {
- return false;
- }
转载于:https://blog.51cto.com/vincenttung/1141062