|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.fitbit.api.client.http.Response
public class Response
A data class representing HTTP Response
| Field Summary | |
|---|---|
protected InputStream |
is
|
protected int |
statusCode
|
| Constructor Summary | |
|---|---|
protected |
Response()
|
|
Response(HttpURLConnection con)
|
| Method Summary | |
|---|---|
Document |
asDocument()
Returns the response body as org.w3c.dom.Document. Disconnects the internal HttpURLConnection silently. |
org.json.JSONArray |
asJSONArray()
Returns the response body as org.json.JSONArray. Disconnects the internal HttpURLConnection silently. |
org.json.JSONObject |
asJSONObject()
Returns the response body as org.json.JSONObject. Disconnects the internal HttpURLConnection silently. |
InputStreamReader |
asReader()
|
InputStream |
asStream()
Returns the response stream. This method cannot be called after calling asString() or asDcoument() It is suggested to call disconnect() after consuming the stream. |
String |
asString()
Returns the response body as string. Disconnects the internal HttpURLConnection silently. |
void |
disconnect()
|
String |
getResponseHeader(String name)
|
int |
getStatusCode()
|
boolean |
isError()
|
String |
toString()
|
static String |
unescape(String original)
Unescape UTF-8 escaped characters to string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int statusCode
protected InputStream is
| Constructor Detail |
|---|
public Response(HttpURLConnection con)
throws IOException
IOExceptionprotected Response()
| Method Detail |
|---|
public int getStatusCode()
public String getResponseHeader(String name)
public InputStream asStream()
FitbitAPIExceptiondisconnect()
public String asString()
throws FitbitAPIException
FitbitAPIException
public Document asDocument()
throws FitbitAPIException
FitbitAPIException
public org.json.JSONObject asJSONObject()
throws FitbitAPIException
FitbitAPIException
public org.json.JSONArray asJSONArray()
throws FitbitAPIException
FitbitAPIExceptionpublic InputStreamReader asReader()
public void disconnect()
public static String unescape(String original)
original - The string to be unescaped.
public String toString()
toString in class Objectpublic boolean isError()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||