Java tutorial
//package com.java2s; import java.io.IOException; import java.net.HttpURLConnection; import java.net.URL; public class Main { private static HttpURLConnection getHttpURLConnection(String strURL) throws IOException { URL url = new URL(strURL); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setConnectTimeout(10000); conn.setReadTimeout(15000); return conn; } }