public abstract class HttpProvider extends TransportProviderBase
Modifier and Type | Field and Description |
---|---|
protected int |
DEFAULT_HTTP_PORT
The default port for HTTP
|
protected int |
DEFAULT_HTTPS_PORT
The default port for HTTPS
|
protected static java.lang.String |
MSG_CODE_OTHER
Message for HTTP status codes without special handling
|
protected static java.lang.String |
MSG_CODE_PREFIX
Prefix for HTTP status codes with special handling
|
protected static java.lang.String |
MSG_COMMS_FAILURE
Some kind of underlying communication failure
|
protected static java.lang.String |
MSG_NO_CONTENT
HTTP Content was expected but none received
|
Modifier | Constructor and Description |
---|---|
protected |
HttpProvider() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getMessage(java.lang.String key,
java.lang.Object... parameters)
Get a localized message for the given key.
|
protected int |
getPort(java.net.URI uri)
Extract the port from a URI.
|
protected java.lang.String |
getStatusMessage(int statusCode,
java.lang.String reasonPhrase)
Get a localized message for the HTTP status code
|
close, compress, decompress, delete, get, getDebugLevel, getProxyCredentials, getProxyLocation, getProxySelector, getRequestPath, getServiceCredentials, getServiceLocation, getUserAgent, head, post, put, readResponseBody, setDebugLevel, setProxyCredentials, setProxyLocation, setServiceCredentials, setServiceLocation, setUserAgent, toString
protected final int DEFAULT_HTTP_PORT
protected final int DEFAULT_HTTPS_PORT
protected static final java.lang.String MSG_NO_CONTENT
protected static final java.lang.String MSG_COMMS_FAILURE
protected static final java.lang.String MSG_CODE_PREFIX
protected static final java.lang.String MSG_CODE_OTHER
protected int getPort(java.net.URI uri)
URI
- the URIprotected java.lang.String getMessage(java.lang.String key, java.lang.Object... parameters)
key
- one of the MSG_ constants in this class.parameters
- optional message parametersprotected java.lang.String getStatusMessage(int statusCode, java.lang.String reasonPhrase)
statusCode
- the HTTP status code of the response.reasonPhrase
- the HTTP reason phrase from the response.