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.Pattern
CHARSET_PATTERN
protected Config
config
private HttpRequestSummary
reqSummary
-
Constructor Summary
Constructors Modifier Constructor Description protected
RawResponseBase(Config config, HttpRequestSummary summary)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
getCharSet()
private java.lang.String
getCharsetFromContentType(java.lang.String contentType)
Parse out a charset from a content type header.Config
getConfig()
Returns the current config for this request/responseHttpRequestSummary
getRequestSummary()
returns a lightweight read only summary of the request.HttpResponseSummary
toSummary()
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:RawResponse
Returns the current config for this request/response- Specified by:
getConfig
in interfaceRawResponse
- Returns:
- the config
-
toSummary
public HttpResponseSummary toSummary()
Description copied from interface:RawResponse
returns a lightweight read only summary of the response.- Specified by:
toSummary
in interfaceRawResponse
- Returns:
- the response summary
-
getRequestSummary
public HttpRequestSummary getRequestSummary()
Description copied from interface:RawResponse
returns a lightweight read only summary of the request.- Specified by:
getRequestSummary
in interfaceRawResponse
- Returns:
- the request summary
-
-