play.libs
类 WS.HttpResponse

java.lang.Object
  继承者 play.libs.WS.HttpResponse
直接已知子类:
WSAsync.HttpAsyncResponse, WSUrlFetch.HttpUrlfetchResponse
包容类:
WS

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

An HTTP response wrapper


构造方法摘要
WS.HttpResponse()
           
 
方法摘要
 java.lang.String getContentType()
          The http response content type
 java.lang.String getEncoding()
           
abstract  java.lang.String getHeader(java.lang.String key)
           
abstract  java.util.List<Http.Header> getHeaders()
           
 JsonElement getJson()
          get the response body as a JsonElement
 java.util.Map<java.lang.String,java.lang.String> getQueryString()
          Parse the response string as a query string.
abstract  java.lang.Integer getStatus()
          the HTTP status code
abstract  java.lang.String getStatusText()
          The HTTP status text
abstract  java.io.InputStream getStream()
          get the response as a stream
 java.lang.String getString()
          get the response body as a string
 java.lang.String getString(java.lang.String encoding)
          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
 boolean success()
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

WS.HttpResponse

public WS.HttpResponse()
方法详细信息

getStatus

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

返回:
the status code of the http response

getStatusText

public abstract java.lang.String getStatusText()
The HTTP status text

返回:
the status text of the http response

success

public boolean success()
返回:
true if the status code is 20x, false otherwise

getContentType

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

返回:
the content type of the http response

getEncoding

public java.lang.String getEncoding()

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

返回:
a DOM document

getXml

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

参数:
encoding - xml charset encoding
返回:
a DOM document

getString

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

返回:
the body of the http response

getString

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

参数:
encoding - string charset encoding
返回:
the body of the http response

getQueryString

public java.util.Map<java.lang.String,java.lang.String> getQueryString()
Parse the response string as a query string.

返回:
The parameters as a Map. Return an empty map if the response is not formed as a query string.

getStream

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

返回:
an inputstream

getJson

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

返回:
the json response


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