Package it.unimi.dsi.law.warc.util
Interface HttpResponse
- All Superinterfaces:
Response
- All Known Implementing Classes:
AbstractHttpResponse,HttpComponentsHttpResponse,MetadataHttpResponse,MutableHttpResponse,WarcHttpResponse
public interface HttpResponse extends Response
Provides high level access to WARC records with
record-type equal to
response and content-type equal to HTTP
(or HTTPS).-
Field Summary
Fields Modifier and Type Field Description static StringDIGEST_HEADERThe WARCanvl-filedname to store the digest.static StringGUESSED_CHARSET_HEADERThe WARCanvl-filedname to store the charset recognized during parsing.static CharsetHEADER_CHARSETTheCharsetused to encode/decode the HTTP headers.static StringISDUPLICATE_HEADERThe WARCanvl-filedname to store the digest. -
Method Summary
Modifier and Type Method Description MeasurableInputStreamcontentAsStream()Returns the content of this response as a stream.Map<String,String>headers()Returns the headers of this response.intstatus()Returns the response status.org.apache.http.StatusLinestatusLine()Returns the response status line.Methods inherited from interface it.unimi.dsi.law.warc.util.Response
fromWarcRecord, uri
-
Field Details
-
GUESSED_CHARSET_HEADER
The WARCanvl-filedname to store the charset recognized during parsing.- See Also:
- Constant Field Values
-
DIGEST_HEADER
The WARCanvl-filedname to store the digest.- See Also:
- Constant Field Values
-
ISDUPLICATE_HEADER
The WARCanvl-filedname to store the digest.- See Also:
- Constant Field Values
-
HEADER_CHARSET
TheCharsetused to encode/decode the HTTP headers.
-
-
Method Details
-
status
int status()Returns the response status.- Returns:
- the status of this response.
-
statusLine
org.apache.http.StatusLine statusLine()Returns the response status line.- Returns:
- the status line of this response.
-
headers
Returns the headers of this response.Warning: as of LAW 3.0, and contrarily to previous behaviour, the map is case-sensitive. Use the predefined names in
HttpHeadersorHttpHeadersto avoid typing and casing mistakes.- Returns:
- the headers of this response.
-
contentAsStream
Returns the content of this response as a stream.- Returns:
- the content of this response as a stream.
- Throws:
IOException
-