Package kong.unirest.core
Class RawResponseBase
- java.lang.Object
-
- kong.unirest.core.RawResponseBase
-
- All Implemented Interfaces:
RawResponse
- Direct Known Subclasses:
JavaResponse
public abstract class RawResponseBase extends java.lang.Object implements RawResponse
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.regex.PatternCHARSET_PATTERNprotected Configconfigprivate HttpRequestSummaryreqSummary
-
Constructor Summary
Constructors Modifier Constructor Description protectedRawResponseBase(Config config, HttpRequestSummary summary)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringgetCharSet()private java.lang.StringgetCharsetFromContentType(java.lang.String contentType)Parse out a charset from a content type header.ConfiggetConfig()Returns the current config for this request/responseHttpRequestSummarygetRequestSummary()returns a lightweight read only summary of the request.HttpResponseSummarytoSummary()returns a lightweight read only summary of the response.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface kong.unirest.core.RawResponse
getContent, getContentAsBytes, getContentAsString, getContentAsString, getContentReader, getContentType, getEncoding, getHeaders, getStatus, getStatusText, hasContent
-
-
-
-
Field Detail
-
CHARSET_PATTERN
private static final java.util.regex.Pattern CHARSET_PATTERN
-
reqSummary
private final HttpRequestSummary reqSummary
-
config
protected Config config
-
-
Constructor Detail
-
RawResponseBase
protected RawResponseBase(Config config, HttpRequestSummary summary)
-
-
Method Detail
-
getCharSet
protected java.lang.String getCharSet()
-
getCharsetFromContentType
private 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.
-
getConfig
public Config getConfig()
Description copied from interface:RawResponseReturns the current config for this request/response- Specified by:
getConfigin interfaceRawResponse- Returns:
- the config
-
toSummary
public HttpResponseSummary toSummary()
Description copied from interface:RawResponsereturns a lightweight read only summary of the response.- Specified by:
toSummaryin interfaceRawResponse- Returns:
- the response summary
-
getRequestSummary
public HttpRequestSummary getRequestSummary()
Description copied from interface:RawResponsereturns a lightweight read only summary of the request.- Specified by:
getRequestSummaryin interfaceRawResponse- Returns:
- the request summary
-
-