play.libs
Class WS.HttpResponse

java.lang.Object
  extended by play.libs.WS.HttpResponse
Enclosing class:
WS

public static class WS.HttpResponse
extends Object

An HTTP response wrapper


Constructor Summary
WS.HttpResponse(org.apache.commons.httpclient.HttpMethod method)
          you shouldnt have to create an HttpResponse yourself
 
Method Summary
 String getContentType()
          The http response content type
 String getHeader(String key)
           
 org.apache.commons.httpclient.Header[] getHeaders()
           
 com.google.gson.JsonElement getJson()
          get the response body as a com.google.gson.JSONObject
 Integer getStatus()
          the HTTP status code
 InputStream getStream()
          get the response as a stream
 String getString()
          get the response body as a string
 Document getXml()
          Parse and get the response body as a DOM document
 Document getXml(String encoding)
          parse and get the response body as a DOM document
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WS.HttpResponse

public WS.HttpResponse(org.apache.commons.httpclient.HttpMethod method)
you shouldnt have to create an HttpResponse yourself

Parameters:
method -
Method Detail

getStatus

public Integer getStatus()
the HTTP status code

Returns:
the status code of the http response

getContentType

public String getContentType()
The http response content type

Returns:
the content type of the http response

getHeader

public String getHeader(String key)

getHeaders

public org.apache.commons.httpclient.Header[] getHeaders()

getXml

public Document getXml()
Parse and get the response body as a DOM document

Returns:
a DOM document

getXml

public Document getXml(String encoding)
parse and get the response body as a DOM document

Parameters:
encoding - xml charset encoding
Returns:
a DOM document

getString

public String getString()
get the response body as a string

Returns:
the body of the http response

getStream

public InputStream getStream()
get the response as a stream

Returns:
an inputstream

getJson

public com.google.gson.JsonElement getJson()
get the response body as a com.google.gson.JSONObject

Returns:
the json response


Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly