public class OkHttpResponse extends Object implements Response
Modifier and Type | Class and Description |
---|---|
static class |
OkHttpResponse.TruncatedContent
Container to store whether and why content has been truncated
|
Response.TruncatedContentReason
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
LOG |
FETCH_TIME, IP_ADDRESS, REQUEST, RESPONSE_HEADERS, TRUNCATED_CONTENT, TRUNCATED_CONTENT_REASON
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
Constructor and Description |
---|
OkHttpResponse(OkHttp okhttp,
URL url,
CrawlDatum datum) |
Modifier and Type | Method and Description |
---|---|
int |
getCode()
Returns the response code.
|
byte[] |
getContent()
Returns the full content of the response.
|
String |
getHeader(String name)
Returns the value of a named header.
|
Metadata |
getHeaders()
Returns all the headers.
|
URL |
getUrl()
Returns the URL used to retrieve this response.
|
public OkHttpResponse(OkHttp okhttp, URL url, CrawlDatum datum) throws ProtocolException, IOException
ProtocolException
IOException
public URL getUrl()
Response
public int getCode()
Response
public String getHeader(String name)
Response
public Metadata getHeaders()
Response
getHeaders
in interface Response
public byte[] getContent()
Response
getContent
in interface Response
Copyright © 2021 The Apache Software Foundation