play.libs
Class WS.Response

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

public static class WS.Response
extends java.lang.Object

A WS response.


Constructor Summary
WS.Response(com.ning.http.client.Response ahcResponse)
           
 
Method Summary
 org.codehaus.jackson.JsonNode asJson()
          Get the response body as a JsonNode
 org.w3c.dom.Document asXml()
          Get the response body as a DOM document
 java.lang.String getBody()
          Get the response body as a string
 java.lang.String getHeader(java.lang.String key)
          Get the given HTTP header of the response
 int getStatus()
          Get the HTTP status code of the response
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WS.Response

public WS.Response(com.ning.http.client.Response ahcResponse)
Method Detail

getStatus

public int getStatus()
Get the HTTP status code of the response


getHeader

public java.lang.String getHeader(java.lang.String key)
Get the given HTTP header of the response


getBody

public java.lang.String getBody()
Get the response body as a string


asXml

public org.w3c.dom.Document asXml()
Get the response body as a DOM document

Returns:
a DOM document

asJson

public org.codehaus.jackson.JsonNode asJson()
Get the response body as a JsonNode

Returns:
the json response