public final class UrlConnections extends Object
URLConnection.| Modifier and Type | Field and Description |
|---|---|
static 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 URLConnection |
followRedirects2(HttpURLConnection httpConn)
The "follow redirects" feature of
HttpURLConnection doesn't support "cross-protocol" redirects, e.g. |
static IOException |
toException(HttpURLConnection httpConn,
Throwable cause) |
public static URLConnection followRedirects2(HttpURLConnection httpConn) throws 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-redirectedIOExceptionpublic static IOException toException(HttpURLConnection httpConn, @Nullable Throwable cause) throws IOException
IOException that contains detailed information about the request, the response,
and the response's "error stream"IOExceptionCopyright © 2018 Arno Unkrig. All rights reserved.