Package org.apache.nutch.protocol.okhttp
Class OkHttpResponse
java.lang.Object
org.apache.nutch.protocol.okhttp.OkHttpResponse
- All Implemented Interfaces:
HttpHeaders,Response
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classContainer to store whether and why content has been truncatedNested classes/interfaces inherited from interface org.apache.nutch.net.protocols.Response
Response.TruncatedContentReason -
Field Summary
FieldsFields 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_TYPEFields inherited from interface org.apache.nutch.net.protocols.Response
CIPHER_SUITES, FETCH_TIME, IP_ADDRESS, PROTOCOL_VERSIONS, REQUEST, RESPONSE_HEADERS, TRUNCATED_CONTENT, TRUNCATED_CONTENT_REASON -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOG
-
-
Constructor Details
-
OkHttpResponse
public OkHttpResponse(OkHttp okhttp, URL url, CrawlDatum datum) throws ProtocolException, IOException - Throws:
ProtocolExceptionIOException
-
-
Method Details
-
getUrl
Description copied from interface:ResponseGet the URL the protocol actually used when requesting the Response. -
getCode
public int getCode()Description copied from interface:ResponseGet the response code. -
getHeader
Description copied from interface:ResponseGet the value of a named header. -
getHeaders
Description copied from interface:ResponseGet all the headers.- Specified by:
getHeadersin interfaceResponse- Returns:
- populated headers
Metadata
-
getContent
public byte[] getContent()Description copied from interface:ResponseGet the full content of the response.- Specified by:
getContentin interfaceResponse- Returns:
- a byte array representing the response content
-