play.libs
Class WS.HttpResponse

java.lang.Object
  extended by play.libs.WS.HttpResponse
Direct Known Subclasses:
WSAsync.HttpAsyncResponse, WSUrlFetch.HttpUrlfetchResponse
Enclosing class:
WS

public abstract static class WS.HttpResponse
extends java.lang.Object

An HTTP response wrapper


Constructor Summary
WS.HttpResponse()
           
 
Method Summary
 java.lang.String getContentType()
          The http response content type
abstract  java.lang.String getHeader(java.lang.String key)
           
abstract  java.util.List<Http.Header> getHeaders()
           
 JsonElement getJson()
          get the response body as a JSONObject
abstract  java.lang.Integer getStatus()
          the HTTP status code
abstract  java.io.InputStream getStream()
          get the response as a stream
abstract  java.lang.String getString()
          get the response body as a string
 org.w3c.dom.Document getXml()
          Parse and get the response body as a DOM document
 org.w3c.dom.Document getXml(java.lang.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()
Method Detail

getStatus

public abstract java.lang.Integer getStatus()
the HTTP status code

Returns:
the status code of the http response

getContentType

public java.lang.String getContentType()
The http response content type

Returns:
the content type of the http response

getHeader

public abstract java.lang.String getHeader(java.lang.String key)

getHeaders

public abstract java.util.List<Http.Header> getHeaders()

getXml

public org.w3c.dom.Document getXml()
Parse and get the response body as a DOM document

Returns:
a DOM document

getXml

public org.w3c.dom.Document getXml(java.lang.String encoding)
parse and get the response body as a DOM document

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

getString

public abstract java.lang.String getString()
get the response body as a string

Returns:
the body of the http response

getStream

public abstract java.io.InputStream getStream()
get the response as a stream

Returns:
an inputstream

getJson

public JsonElement getJson()
get the response body as a JSONObject

Returns:
the json response


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