public interface Response
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_BODY_DISPLAY_LENGTH
The maximum number of response body characters to display.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
asBytes()
The body of the response as a byte array, for dealing with binary data or
troubleshooting encoding issues.
|
com.fasterxml.jackson.databind.JsonNode |
asJson()
Returns the JSON response content as a JsonNode, or throws RuntimeMappingException.
|
String |
asText()
What was the content of the response?
|
Element |
asXml()
Returns the XML response content as an org.w3c.Element, or throws RuntimeMappingException.
|
void |
bigDump()
Prints the output of
toString() to System.out, but without truncating the response body. |
void |
dump()
Prints the output of
toString() to System.out. |
String |
getContent()
What was the content of the response?
|
Header |
getHeader(String headerName)
Get the value of an individual Header.
|
List<Header> |
getHeaders()
What headers did the server send?
|
List<Header> |
getHeaders(String headerName)
Get the all headers with the specified name.
|
long |
getResponseTime()
How long did the response take?
|
int |
getStatusCode()
What was the response code?
|
void |
tinyDump()
Prints the output of
toCompactString() to System.out. |
String |
toBigString()
Returns the response headers and body, without truncating the body.
|
String |
toCompactString()
Returns the response as a compact single-line String.
|
String |
toString()
Returns the response headers and body, truncating the body.
|
static final int MAX_BODY_DISPLAY_LENGTH
int getStatusCode()
String getContent()
String asText()
byte[] asBytes()
List<Header> getHeaders(String headerName)
headerName - The name of the headerHeader getHeader(String headerName)
getHeaders(String).headerName - The name of the headerlong getResponseTime()
com.fasterxml.jackson.databind.JsonNode asJson()
Element asXml()
String toCompactString()
String toString()
String toBigString()
void tinyDump()
toCompactString() to System.out.void dump()
toString() to System.out.void bigDump()
toString() to System.out, but without truncating the response body. This could be a very large dump.Copyright © 2012. All Rights Reserved.