use of org.pixmob.httpclient.HttpClient in project httpclient by pixmob.
the class Task method createClient.
protected HttpClient createClient() {
final HttpClient hc = new HttpClient(context);
hc.setConnectTimeout(4000);
hc.setReadTimeout(8000);
return hc;
}
use of org.pixmob.httpclient.HttpClient in project httpclient by pixmob.
the class HttpsTask method doRun.
@Override
protected void doRun() throws Exception {
final String[] httpsUrls = { "https://www.google.com", "https://www.facebook.com", "https://twitter.com", "https://mobile.free.fr/moncompte/" };
final HttpClient hc = createClient();
for (final String url : httpsUrls) {
hc.get(url).expect(HttpURLConnection.HTTP_OK, HttpURLConnection.HTTP_MOVED_TEMP, HttpURLConnection.HTTP_MOVED_PERM).execute();
}
}
Aggregations