public class HttpUrlConnectionMessageSender extends AbstractHttpWebServiceMessageSender
WebServiceMessageSender
implementation that uses standard J2SE facilities to
execute POST requests, without support for HTTP authentication or advanced
configuration options.
Consider HttpComponentsMessageSender
for more sophisticated needs: this class
is rather limited in its capabilities.
HttpURLConnection
logger
Constructor and Description |
---|
HttpUrlConnectionMessageSender() |
Modifier and Type | Method and Description |
---|---|
WebServiceConnection |
createConnection(URI uri)
Create a new
WebServiceConnection to the specified URI. |
protected void |
prepareConnection(HttpURLConnection connection)
Template method for preparing the given
HttpURLConnection . |
isAcceptGzipEncoding, setAcceptGzipEncoding, supports
public WebServiceConnection createConnection(URI uri) throws IOException
WebServiceMessageSender
WebServiceConnection
to the specified URI.uri
- the URI to open a connection toIOException
- in case of I/O errorsprotected void prepareConnection(HttpURLConnection connection) throws IOException
HttpURLConnection
.
The default implementation prepares the connection for input and output, sets the HTTP method to POST, disables
caching, and sets the Accept-Encoding
header to gzip, if applicable.
connection
- the connection to prepareIOException
- in case of I/O errorsCopyright © 2020 Pivotal Software. All rights reserved.