Class HttpResponse

java.lang.Object
org.apache.nutch.protocol.httpclient.HttpResponse
All Implemented Interfaces:
HttpHeaders, Response

public class HttpResponse extends Object implements Response
An HTTP response.
Author:
Susam Pal
  • Method Details

    • getUrl

      public URL getUrl()
      Description copied from interface: Response
      Get the URL the protocol actually used when requesting the 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
    • getHeaders

      public Metadata getHeaders()
      Description copied from interface: Response
      Get all the headers.
      Specified by:
      getHeaders in interface Response
      Returns:
      populated headers Metadata
    • 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