public class BoxJSONResponse extends BoxAPIResponse
This request type extends BoxAPIResponse to provide additional functionality for handling JSON strings. It reads the response body into a string and allows the JSON in the response to be logged.
| Constructor and Description |
|---|
BoxJSONResponse()
Constructs a BoxJSONResponse without an associated HttpURLConnection.
|
BoxJSONResponse(HttpURLConnection connection)
Constructs a BoxJSONResponse using an HttpURLConnection.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
bodyToString()
Returns a string representation of this response's body.
|
String |
getJSON()
Gets the body of the response as a JSON string.
|
disconnect, getBody, getBody, getContentLength, getResponseCode, toStringpublic BoxJSONResponse()
public BoxJSONResponse(HttpURLConnection connection)
connection - a connection that has already sent a request to the API.public String getJSON()
BoxAPIResponse.getBody() can no longer be used.protected String bodyToString()
BoxAPIResponsebodyToString in class BoxAPIResponse