public abstract class HttpResponse
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected HttpClientConfiguration |
CONF |
protected java.io.InputStream |
is |
protected java.lang.String |
responseAsString |
protected int |
statusCode |
| Constructor and Description |
|---|
HttpResponse(HttpClientConfiguration conf) |
| Modifier and Type | Method and Description |
|---|---|
JSONArray |
asJSONArray()
Returns the response body as twitter4jads.internal.org.json.JSONArray.
Disconnects the internal HttpURLConnection silently. |
JSONObject |
asJSONObject()
Returns the response body as twitter4jads.internal.org.json.JSONObject.
Disconnects the internal HttpURLConnection silently. |
java.io.Reader |
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. |
abstract void |
disconnect() |
abstract java.lang.String |
getResponseHeader(java.lang.String name) |
abstract java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getResponseHeaderFields() |
int |
getStatusCode() |
java.lang.String |
toString() |
protected final HttpClientConfiguration CONF
protected int statusCode
protected java.lang.String responseAsString
protected java.io.InputStream is
public HttpResponse(HttpClientConfiguration conf)
public int getStatusCode()
public abstract java.lang.String getResponseHeader(java.lang.String name)
public abstract java.util.Map<java.lang.String,java.util.List<java.lang.String>> getResponseHeaderFields()
public java.io.InputStream asStream()
TwitterExceptiondisconnect()public java.lang.String asString()
throws TwitterException
TwitterExceptionpublic JSONObject asJSONObject() throws TwitterException
TwitterExceptionpublic JSONArray asJSONArray() throws TwitterException
TwitterExceptionpublic java.io.Reader asReader()
public abstract void disconnect()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Object