Interface ContentResponse
- All Superinterfaces:
 Response
- 
Nested Class Summary
Nested classes/interfaces inherited from interface Response
Response.AsyncContentListener, Response.BeginListener, Response.CompleteListener, Response.ContentListener, Response.ContentSourceListener, Response.FailureListener, Response.HeaderListener, Response.HeadersListener, Response.Listener, Response.ResponseListener, Response.SuccessListener - 
Method Summary
Methods inherited from interface Response
abort, getHeaders, getReason, getRequest, getStatus, getTrailers, getVersion 
- 
Method Details
- 
from
- Parameters:
 response- the Response with status code and headerscontent- the content bytes associated to the responsemediaType- the media type of the content bytesencoding- the encoding of the content bytes- Returns:
 - a new ContentResponse from the given arguments
 
 - 
getMediaType
String getMediaType()- Returns:
 - the media type of the content, such as "text/html" or "application/octet-stream"
 
 - 
getEncoding
String getEncoding()- Returns:
 - the encoding of the content, such as "UTF-8"
 
 - 
getContent
byte[] getContent()- Returns:
 - the response content
 
 - 
getContentAsString
String getContentAsString()- Returns:
 - the response content as a string, decoding the bytes using the charset
provided by the 
Content-Typeheader, if any, or UTF-8. 
 
 -