Class ResponseUtils
- java.lang.Object
-
- io.joshworks.restclient.http.utils.ResponseUtils
-
public class ResponseUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ResponseUtils()
-
Method Summary
Modifier and Type Method Description static java.lang.StringgetCharsetFromContentType(java.lang.String contentType)Parse out a charset from a content type header.static booleanisGzipped(org.apache.http.Header contentEncoding)static byte[]readBytes(java.io.InputStream is)
-
-
-
Method Detail
-
getCharsetFromContentType
public static java.lang.String getCharsetFromContentType(java.lang.String contentType)
Parse out a charset from a content type header.- Parameters:
contentType- e.g. "text/html; charset=EUC-JP"- Returns:
- "EUC-JP", or null if not found. Charset is trimmed and uppercased.
-
readBytes
public static byte[] readBytes(java.io.InputStream is) throws java.io.IOException- Throws:
java.io.IOException
-
isGzipped
public static boolean isGzipped(org.apache.http.Header contentEncoding)
-
-