JavaScript is disabled on your browser.
play.libs

Class WS.Response

  • Enclosing class:
    WS


    public static class WS.Response
    extends java.lang.Object
    A WS response.
    • Constructor Summary

      Constructors
      Constructor and Description
      WS.Response (com.ning.http.client.Response ahcResponse)
    • Method Summary

      Methods
      Modifier and Type Method and Description
      byte[] asByteArray ()
      Get the response body as a byte array
      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.io.InputStream getBodyAsStream ()
      Get the response body as a stream
      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
      java.lang.String getStatusText ()
      Get the HTTP status text of the response
      java.net.URI getUri ()
      Return the request URI.
      • 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
      • getStatusText

        public java.lang.String getStatusText()
        Get the HTTP status text 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. If the charset is not specified, this defaults to ISO-8859-1 for text sub mime types, as per RFC-2616 sec 3.7.1, otherwise it defaults to UTF-8.
      • 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
      • getBodyAsStream

        public java.io.InputStream getBodyAsStream()
        Get the response body as a stream
        Returns:
        The stream to read the response body from
      • asByteArray

        public byte[] asByteArray()
        Get the response body as a byte array
        Returns:
        The byte array
      • getUri

        public java.net.URI getUri()
        Return the request URI. Note that if the request got redirected, the value of the URI will be the last valid redirect url.
        Returns:
        the request URI.

AltStyle によって変換されたページ (->オリジナル) /