twitter4j.http
Class Response

java.lang.Object
  extended by twitter4j.http.Response

public class Response
extends java.lang.Object

A data class representing HTTP Response

Author:
Yusuke Yamamoto - yusuke at mac.com

Constructor Summary
Response(java.net.HttpURLConnection con)
           
 
Method Summary
 org.w3c.dom.Document asDocument()
          Returns the response body as org.w3c.dom.Document.
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
 

Constructor Detail

Response

public Response(java.net.HttpURLConnection con)
         throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getStatusCode

public int getStatusCode()

getResponseHeader

public java.lang.String getResponseHeader(java.lang.String name)

asStream

public 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. Disconnects the internal HttpURLConnection silently.

Returns:
response body stream
Throws:
TwitterException
See Also:
disconnect()

asString

public java.lang.String asString()
                          throws TwitterException
Returns the response body as string.
Disconnects the internal HttpURLConnection silently.

Returns:
response body
Throws:
TwitterException

asDocument

public org.w3c.dom.Document asDocument()
                                throws TwitterException
Returns the response body as org.w3c.dom.Document.
Disconnects the internal HttpURLConnection silently.

Returns:
response body as org.w3c.dom.Document
Throws:
TwitterException

asJSONObject

public twitter4j.org.json.JSONObject asJSONObject()
                                           throws TwitterException
Returns the response body as twitter4j.org.json.JSONObject.
Disconnects the internal HttpURLConnection silently.

Returns:
response body as twitter4j.org.json.JSONObject
Throws:
TwitterException

asReader

public java.io.InputStreamReader asReader()

disconnect

public void disconnect()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2009. All Rights Reserved.