|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object twitter4j.http.HttpResponse
public class HttpResponse
A data class representing HTTP Response
Field Summary | |
---|---|
private static java.lang.ThreadLocal<javax.xml.parsers.DocumentBuilder> |
builders
|
private java.net.HttpURLConnection |
con
|
private java.io.InputStream |
is
|
private static Logger |
logger
|
private org.w3c.dom.Document |
responseAsDocument
|
private java.lang.String |
responseAsString
|
private int |
statusCode
|
private boolean |
streamConsumed
|
Constructor Summary | |
---|---|
HttpResponse(java.net.HttpURLConnection con)
|
|
HttpResponse(java.lang.String content)
|
Method Summary | |
---|---|
org.w3c.dom.Document |
asDocument()
Returns the response body as org.w3c.dom.Document. Disconnects the internal HttpURLConnection silently. |
twitter4j.org.json.JSONArray |
asJSONArray()
Returns the response body as twitter4j.org.json.JSONArray. Disconnects the internal HttpURLConnection silently. |
twitter4j.org.json.JSONObject |
asJSONObject()
Returns the response body as twitter4j.org.json.JSONObject. Disconnects the internal HttpURLConnection silently. |
java.io.InputStreamReader |
asReader()
|
java.io.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. |
java.lang.String |
asString()
Returns the response body as string. Disconnects the internal HttpURLConnection silently. |
void |
disconnect()
|
java.lang.String |
getResponseHeader(java.lang.String name)
|
int |
getStatusCode()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final Logger logger
private static java.lang.ThreadLocal<javax.xml.parsers.DocumentBuilder> builders
private int statusCode
private org.w3c.dom.Document responseAsDocument
private java.lang.String responseAsString
private java.io.InputStream is
private java.net.HttpURLConnection con
private boolean streamConsumed
Constructor Detail |
---|
public HttpResponse(java.net.HttpURLConnection con) throws java.io.IOException
java.io.IOException
HttpResponse(java.lang.String content)
Method Detail |
---|
public int getStatusCode()
public java.lang.String getResponseHeader(java.lang.String name)
public java.io.InputStream asStream()
TwitterException
disconnect()
public java.lang.String asString() throws TwitterException
TwitterException
public org.w3c.dom.Document asDocument() throws TwitterException
TwitterException
public twitter4j.org.json.JSONObject asJSONObject() throws TwitterException
TwitterException
public twitter4j.org.json.JSONArray asJSONArray() throws TwitterException
TwitterException
public java.io.InputStreamReader asReader()
public void disconnect()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |