@Immutable public final class JacksonResponse extends Object
| Modifier and Type | Class and Description | 
|---|---|
static class  | 
JacksonResponse.JsonReader
A tree representation views of JSON documents. 
 | 
| Constructor and Description | 
|---|
JacksonResponse(Response resp)
Ctor. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
<T extends Response> | 
as(Class<T> type)
Convert it to another type, by encapsulation. 
 | 
Request | 
back()
Get back to the request it's related to. 
 | 
byte[] | 
binary()
Raw body as a an array of bytes. 
 | 
String | 
body()
Get body as a string, assuming it's  
UTF-8 (if there is something
 else that can't be translated into a UTF-8 string a runtime exception
 will be thrown). | 
Map<String,List<String>> | 
headers()
Get a collection of all headers. 
 | 
JacksonResponse.JsonReader | 
json()
Read the body as JSON. 
 | 
String | 
reason()
Get status line reason phrase. 
 | 
int | 
status()
Get status of the response as a positive integer number. 
 | 
String | 
toString()  | 
public JacksonResponse(Response resp)
resp - Responsepublic JacksonResponse.JsonReader json()
public final Request back()
Responsepublic final int status()
Responsepublic final String reason()
Responsepublic final Map<String,List<String>> headers()
Responsepublic String body()
ResponseUTF-8 (if there is something
 else that can't be translated into a UTF-8 string a runtime exception
 will be thrown).
 DISCLAIMER:
 The only encoding supported here is UTF-8. If the body of response
 contains any chars that can't be used and should be replaced with
 a "replacement character", a RuntimeException will be thrown. If
 you need to use some other encodings, use
 Response.binary() instead.
public final byte[] binary()
ResponseCopyright © 2012–2021 jcabi.com. All rights reserved.