Package play.libs.ws

Class WSAsync.HttpAsyncResponse

  • Enclosing class:
    WSAsync

    public static class WSAsync.HttpAsyncResponse
    extends WS.HttpResponse
    An HTTP response wrapper
    • Constructor Detail

      • HttpAsyncResponse

        public HttpAsyncResponse​(com.ning.http.client.Response response)
        You shouldn't have to create an HttpResponse yourself
        Parameters:
        response - The given response
    • Method Detail

      • getStatus

        public java.lang.Integer getStatus()
        The HTTP status code
        Specified by:
        getStatus in class WS.HttpResponse
        Returns:
        the status code of the http response
      • getStatusText

        public java.lang.String getStatusText()
        the HTTP status text
        Specified by:
        getStatusText in class WS.HttpResponse
        Returns:
        the status text of the http response
      • getHeader

        public java.lang.String getHeader​(java.lang.String key)
        Specified by:
        getHeader in class WS.HttpResponse
      • getString

        public java.lang.String getString()
        Description copied from class: WS.HttpResponse
        get the response body as a string
        Specified by:
        getString in class WS.HttpResponse
        Returns:
        the body of the http response
      • getString

        public java.lang.String getString​(java.lang.String encoding)
        Description copied from class: WS.HttpResponse
        get the response body as a string
        Specified by:
        getString in class WS.HttpResponse
        Parameters:
        encoding - string charset encoding
        Returns:
        the body of the http response
      • getStream

        public java.io.InputStream getStream()
        get the response as a stream
        Specified by:
        getStream in class WS.HttpResponse
        Returns:
        an inputstream