Package play.libs.ws

Class DummyHttpResponse

    • Constructor Detail

      • DummyHttpResponse

        public DummyHttpResponse​(int status,
                                 java.lang.String body,
                                 Http.Header... headers)
    • Method Detail

      • getStatus

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

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

        @Nullable
        public java.lang.String getHeader​(java.lang.String name)
        Specified by:
        getHeader in class HttpResponse
      • getString

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

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

        public java.io.InputStream getStream()
        Description copied from class: HttpResponse
        get the response as a stream

        + this method can only be called onced because async implementation does not allow it to be called + multiple times +

        Specified by:
        getStream in class HttpResponse
        Returns:
        an inputstream
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object