org.apache.nutch.net.protocols

## Interface Response

- All Superinterfaces:
    HttpHeaders
  All Known Implementing Classes:
    HttpResponse, HttpResponse, HttpResponse, HttpResponse, HttpResponse, OkHttpResponse

      public interface Response
      extends HttpHeaders

  A response interface. Makes all protocols model HTTP.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `Response.TruncatedContentReason`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `FETCH_TIME` Key to hold the time when the page has been fetched
    `static java.lang.String` | `IP_ADDRESS` Key to hold the IP address the request is sent to if `store.ip.address` is true
    `static java.lang.String` | `REQUEST` Key to hold the HTTP request if `store.http.request` is true
    `static java.lang.String` | `RESPONSE_HEADERS` Key to hold the HTTP response header if `store.http.headers` is true
    `static java.lang.String` | `TRUNCATED_CONTENT` Key to hold boolean whether content has been truncated, e.g., because it exceeds `http.content.limit`
    `static java.lang.String` | `TRUNCATED_CONTENT_REASON` Key to hold reason why content has been truncated, see `Response.TruncatedContentReason`

    - ### 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 Abstract 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.

- - ### Field Detail

    - #### REQUEST

          static final java.lang.String REQUEST

      Key to hold the HTTP request if `store.http.request` is true
      See Also:
        Constant Field Values

    - #### RESPONSE_HEADERS

          static final java.lang.String RESPONSE_HEADERS

      Key to hold the HTTP response header if `store.http.headers` is true
      See Also:
        Constant Field Values

    - #### IP_ADDRESS

          static final java.lang.String IP_ADDRESS

      Key to hold the IP address the request is sent to if `store.ip.address` is true
      See Also:
        Constant Field Values

    - #### FETCH_TIME

          static final java.lang.String FETCH_TIME

      Key to hold the time when the page has been fetched
      See Also:
        Constant Field Values

    - #### TRUNCATED_CONTENT

          static final java.lang.String TRUNCATED_CONTENT

      Key to hold boolean whether content has been truncated, e.g., because it exceeds `http.content.limit`
      See Also:
        Constant Field Values

    - #### TRUNCATED_CONTENT_REASON

          static final java.lang.String TRUNCATED_CONTENT_REASON

      Key to hold reason why content has been truncated, see `Response.TruncatedContentReason`
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getUrl

          java.net.URL getUrl()

      Returns the URL used to retrieve this response.

    - #### getCode

          int getCode()

      Returns the response code.

    - #### getHeader

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

      Returns the value of a named header.

    - #### getHeaders

          Metadata getHeaders()

      Returns all the headers.

    - #### getContent

          byte[] getContent()

      Returns the full content of the response.

Copyright © 2019 The Apache Software Foundation