#Java - Code Snippets for '#Java.net.HttpURLConnection' - 3 code snippet(s) found |
|
Sample 1. Usage of java.net.HttpURLConnection | |
|
HttpURLConnection hc = (HttpURLConnection) new URL(tldurl).openConnection();
if (modTime > 0) {
SimpleDateFormat sdf = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z");//Sun, 06 Nov 1994 08:49:37 GMT
String since = sdf.format(new Date(modTime));
hc.addRequestProperty("If-Modified-Since", since);
}
|
|
Like Feedback java.net.HttpURLConnection HttpURLConnection |
|
|
Sample 2. Usage of org.xml.sax.XMLReader | |
|
XMLReader xr = XMLReaderFactory.createXMLReader();
xr.setContentHandler(this);
HttpURLConnection connection = openConnection("/listPaths" + path,
"ugi=" + ugi + (recur? "&recursive=yes" : ""));
connection.setRequestMethod("GET");
connection.connect();
InputStream resp = connection.getInputStream();
xr.parse(new InputSource(resp));
|
|
Like Feedback org.xml.sax.XMLReader |
|
|
Sample 3. Code Sample / Example / Snippet of java.net.HttpURLConnection | |
|
private HttpURLConnection openConnection() throws IOException {
URL url = m_uri.toURL();
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setInstanceFollowRedirects(m_client.isFollowRedirects());
conn.setAllowUserInteraction(false);
conn.setDefaultUseCaches(false);
conn.setUseCaches(false);
conn.setConnectTimeout(1000);
conn.setReadTimeout(1000);
return conn;
}
|
|
Like Feedback java.net.HttpURLConnection |
|
|