public class ResponseUtil extends Object
HttpResponse| Modifier and Type | Field and Description |
|---|---|
static int |
BUFFER_SIZE |
| Constructor and Description |
|---|
ResponseUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
formatJSON(String json)
Returns a JSON
String in human-readable form. |
static InputStream |
getInputStream(org.apache.http.HttpResponse response)
Returns a String representation of the response.
|
static org.json.JSONObject |
getJSON(org.apache.http.HttpResponse response)
Return a JSON representation of the response.
|
static org.json.JSONArray |
getJSONArray(org.apache.http.HttpResponse response)
Returns a JSONArray representation of the response.
|
static String |
getString(org.apache.http.HttpResponse response)
Returns a String representation of the response.
|
public static final int BUFFER_SIZE
public static String formatJSON(String json)
String in human-readable form.json - the JSON stringpublic static org.json.JSONObject getJSON(org.apache.http.HttpResponse response)
throws IOException
response - the HttpResponseIOException - Signals that an I/O exception has occurred.public static org.json.JSONArray getJSONArray(org.apache.http.HttpResponse response)
throws IOException
response - an HTTP responseIOException - network errorpublic static String getString(org.apache.http.HttpResponse response) throws IOException
response - an HTTP responseIOException - network errorpublic static InputStream getInputStream(org.apache.http.HttpResponse response) throws IOException
response - an HTTP responseIOException - network errorCopyright © 2015. All rights reserved.