Class VResponse

    • Field Detail

      • DEFAULT_CHARSET

        public static final Charset DEFAULT_CHARSET
        The default charset to be used to decode response.
    • Constructor Detail

      • VResponse

        public VResponse​(Response response)
        Constructs a VResponse.
        Parameters:
        response - An instance of response
    • Method Detail

      • getStatusCode

        public final int getStatusCode()
        Description copied from interface: Response
        Returns status code of the response.
        Specified by:
        getStatusCode in interface Response
        Returns:
        int code
      • getContent

        public final byte[] getContent()
        Description copied from interface: Response
        Returns raw content of the response.
        Specified by:
        getContent in interface Response
        Returns:
        byte[] content
      • getContentType

        @NotNull
        public final @NotNull org.apache.http.entity.ContentType getContentType()
        Description copied from interface: Response
        Returns the content type of the content fetched.

        This is provided by the server or guessed by the server or an amalgamation of both.

        Specified by:
        getContentType in interface Response
        Returns:
        an instance of ContentType
      • getHeaders

        @NotNull
        public final @NotNull org.apache.http.Header[] getHeaders()
        Description copied from interface: Response
        Returns the headers that were used to trigger this response.
        Specified by:
        getHeaders in interface Response
        Returns:
        an array of headers
      • getUrl

        @NotNull
        public final @NotNull String getUrl()
        Description copied from interface: Response
        Returns the url used to fetch the response, if the request is redirected, this will be the final requested url.
        Specified by:
        getUrl in interface Response
        Returns:
        stripped down version of requested url
      • getBaseUrl

        @NotNull
        public final @NotNull String getBaseUrl()
        Description copied from interface: Response
        Returns the base form of the url used in this request.
        Specified by:
        getBaseUrl in interface Response
        Returns:
        stripped down version of requested url
      • getProxy

        public final org.apache.http.HttpHost getProxy()
        Description copied from interface: Response
        Returns the proxy that was used to trigger this response.
        Specified by:
        getProxy in interface Response
        Returns:
        proxy used
      • getHtml

        public final String getHtml()
        Returns the html in string format.
        Returns:
        string of html response
      • getHtml

        public final String getHtml​(Charset charset)
        Returns the html in string format.
        Parameters:
        charset - use specified charset for this html document
        Returns:
        string of html response
      • getJsoup

        public final org.jsoup.nodes.Document getJsoup()
        Returns a jsoup document of this response.
        Returns:
        jsoup document of response
      • getJsoup

        public final org.jsoup.nodes.Document getJsoup​(Charset charset)
        Returns a jsoup document of this response.
        Parameters:
        charset - use specified charset for this html document
        Returns:
        jsoup document of response
      • getInner

        public final Response getInner()
        Description copied from interface: Unwrappable
        Returns the unwrapped version of this request.
        Specified by:
        getInner in interface Unwrappable
        Returns:
        an instance of request