org.apache.nutch.protocol.httpclient

## Class HttpResponse

- java.lang.Object
- - org.apache.nutch.protocol.httpclient.HttpResponse

- All Implemented Interfaces:
    HttpHeaders, Response

      public class HttpResponse
      extends java.lang.Object
      implements Response

  An HTTP response.
  Author:
    Susam Pal

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.nutch.net.protocols.Response

      `Response.TruncatedContentReason`

  - ### Field Summary

    - ### Fields inherited from interface org.apache.nutch.net.protocols.Response

      `FETCH_TIME, IP_ADDRESS, REQUEST, RESPONSE_HEADERS, TRUNCATED_CONTENT, TRUNCATED_CONTENT_REASON`

    - ### Fields inherited from interface org.apache.nutch.metadata.HttpHeaders

      `CLIENT_TRANSFER_ENCODING, CONTENT_DISPOSITION, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_LOCATION, CONTENT_MD5, CONTENT_TYPE, IF_MODIFIED_SINCE, LAST_MODIFIED, LOCATION, TRANSFER_ENCODING, USER_AGENT, WRITABLE_CONTENT_TYPE`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getCode()` Returns the response code.
    `byte[]` | `getContent()` Returns the full content of the response.
    `java.lang.String` | `getHeader(java.lang.String name)` Returns the value of a named header.
    `Metadata` | `getHeaders()` Returns all the headers.
    `java.net.URL` | `getUrl()` Returns the URL used to retrieve this response.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getUrl

          public java.net.URL getUrl()

      Description copied from interface: `Response`
      Returns the URL used to retrieve this response.
      Specified by:
        `getUrl` in interface `Response`

    - #### getCode

          public int getCode()

      Description copied from interface: `Response`
      Returns the response code.
      Specified by:
        `getCode` in interface `Response`

    - #### getHeader

          public java.lang.String getHeader(java.lang.String name)

      Description copied from interface: `Response`
      Returns the value of a named header.
      Specified by:
        `getHeader` in interface `Response`

    - #### getHeaders

          public Metadata getHeaders()

      Description copied from interface: `Response`
      Returns all the headers.
      Specified by:
        `getHeaders` in interface `Response`

    - #### getContent

          public byte[] getContent()

      Description copied from interface: `Response`
      Returns the full content of the response.
      Specified by:
        `getContent` in interface `Response`

Copyright © 2019 The Apache Software Foundation