Class HttpResponse

    • Constructor Detail

      • HttpResponse

        public HttpResponse​(HttpBase http,
                            URL url,
                            CrawlDatum datum)
                     throws ProtocolException,
                            IOException
        Default public constructor.
        Parameters:
        http - the HttpBase for this URL
        url - the canonical URL associated with the response
        datum - crawl information for the URL
        Throws:
        ProtocolException - if the URL does not use HTTP protocol
        IOException - if there is a fatal I/O error, typically to do with Socket's
    • Method Detail

      • getUrl

        public URL getUrl()
        Description copied from interface: Response
        Get the URL used to retrieve this response.
        Specified by:
        getUrl in interface Response
        Returns:
        URL
      • getCode

        public int getCode()
        Description copied from interface: Response
        Get the response code.
        Specified by:
        getCode in interface Response
        Returns:
        protocol response code (int)
      • getHeader

        public String getHeader​(String name)
        Description copied from interface: Response
        Get the value of a named header.
        Specified by:
        getHeader in interface Response
        Parameters:
        name - key of the header you wish to retrieve
        Returns:
        header value
      • getContent

        public byte[] getContent()
        Description copied from interface: Response
        Get the full content of the response.
        Specified by:
        getContent in interface Response
        Returns:
        a byte array representing the response content