public interface HTTPResponse
AbstractOpenWebService
retrieves the contents of an HTTP request
issued through its HTTPClient
.
An HTTPResponse instance shall be disposed
as soon as it's response stream
has been consumed or is no longer needed. It's up to the
implementations to just close the actual InputStream
or return the http connection to the
connection pool, or any other resource clean up task that needs to be done.
HTTPClient
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Disposes this HTTP response and cleans up any resource being held.
|
String |
getContentType()
Short cut for
getResponseHeader("Content-Type") |
String |
getResponseCharset() |
String |
getResponseHeader(String headerName)
Returns the value of the requested HTTP response header, or
null if not set. |
InputStream |
getResponseStream()
Returns the HTTP response content byte stream, automatically recognizing gzip encoded
responses and returning an uncompressing stream if that's the case.
|
void dispose()
Multiple invocations of this method shall not raise an exception but return silently.
String getContentType()
getResponseHeader("Content-Type")
String getResponseHeader(String headerName)
null
if not set.InputStream getResponseStream() throws IOException
IOException
- if such happens when obtaining the response stream.String getResponseCharset()
null
otherwise.Copyright © 1996–2019 Geotools. All rights reserved.