qihoo.open.v1.http
类 Response

java.lang.Object
  继承者 qihoo.open.v1.http.Response

public class Response
extends Object


构造方法摘要
Response()
           
Response(HttpURLConnection con)
           
Response(String content)
           
 
方法摘要
 Document asDocument()
          Returns the response body as org.w3c.dom.Document.
 JSONArray asJSONArray()
          Returns the response body as sinat4j.org.json.JSONArray.
 JSONObject asJSONObject()
          Returns the response body as sinat4j.org.json.JSONObject.
 InputStreamReader asReader()
           
 InputStream asStream()
          Returns the response stream.
 String asString()
          Returns the response body as string.
 void disconnect()
           
 String getResponseAsString()
           
 String getResponseHeader(String name)
           
 int getStatusCode()
           
 void setResponseAsString(String responseAsString)
           
 void setStatusCode(int statusCode)
           
 String toString()
           
static String unescape(String original)
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

Response

public Response()

Response

public Response(HttpURLConnection con)
         throws IOException
抛出:
IOException

Response

public Response(String content)
方法详细信息

getStatusCode

public int getStatusCode()

getResponseHeader

public String getResponseHeader(String name)

asStream

public 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.

返回:
response body stream
抛出:
QihooOpenException
另请参见:
disconnect()

asString

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

返回:
response body
抛出:
QihooOpenException

asDocument

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

返回:
response body as org.w3c.dom.Document
抛出:
QihooOpenException

asJSONObject

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

返回:
response body as sinat4j.org.json.JSONObject
抛出:
QihooOpenException

asJSONArray

public JSONArray asJSONArray()
                      throws QihooOpenException
Returns the response body as sinat4j.org.json.JSONArray.
Disconnects the internal HttpURLConnection silently.

返回:
response body as sinat4j.org.json.JSONArray
抛出:
QihooOpenException

asReader

public InputStreamReader asReader()

disconnect

public void disconnect()

unescape

public static String unescape(String original)

toString

public String toString()
覆盖:
Object 中的 toString

getResponseAsString

public String getResponseAsString()

setResponseAsString

public void setResponseAsString(String responseAsString)

setStatusCode

public void setStatusCode(int statusCode)


Copyright © 2013. All rights reserved.