public final class UrlConnections
extends java.lang.Object
URLConnection.| Modifier and Type | Field and Description |
|---|---|
static java.nio.charset.Charset |
HTTP_DEFAULT_CHARSET
The charset that applies if the HTTP "Content-Type:" header is missing or has no "charset" parameter.
|
| Modifier and Type | Method and Description |
|---|---|
static java.net.URLConnection |
followRedirects2(java.net.HttpURLConnection httpConn)
The "follow redirects" feature of
HttpURLConnection doesn't support "cross-protocol" redirects, e.g. |
static java.io.IOException |
toException(java.net.HttpURLConnection httpConn,
java.lang.Throwable cause) |
public static final java.nio.charset.Charset HTTP_DEFAULT_CHARSET
See RFC 2616, sections "3.4.1 Missing Charset" and "3.7.1 Canonicalization and Text Defaults".
public static java.net.URLConnection followRedirects2(java.net.HttpURLConnection httpConn)
throws java.io.IOException
HttpURLConnection doesn't support "cross-protocol" redirects, e.g.
from "http://foo" to "https://foo". This methods implements them.URLConnection iff the connection was cross-protocol-redirectedjava.io.IOExceptionpublic static java.io.IOException toException(java.net.HttpURLConnection httpConn,
@Nullable
java.lang.Throwable cause)
throws java.io.IOException
IOException that contains detailed information about the request, the response,
and the response's "error stream"java.io.IOException