Package esendex.sdk.java.http
Interface HttpConnector
- All Known Implementing Classes:
HttpConnectorImpl
public interface HttpConnector
An HttpConnector connects to an Http resource sending an optional request
and receiving a response.
- Author:
- Mike Whittaker
-
Method Summary
Modifier and TypeMethodDescriptionconnect
(URL url, HttpRequestMethod method, String data, Authenticator authenticator) Connects to a URL and obtains a response.
-
Method Details
-
connect
HttpResponse connect(URL url, HttpRequestMethod method, String data, Authenticator authenticator) throws HttpException Connects to a URL and obtains a response. Optional data can be sent on the connection. An Authenticator is used to write out the correct authentication headers.- Parameters:
url
- the endpoint of the requestmethod
- the Http method to use for the connectiondata
- any data that forms the request and which may be nullauthenticator
- the Authenticator with which to authenticate the connection- Returns:
- a response that wraps the status and any response data
- Throws:
HttpException
- if there are any IO problem during the underlying connection or the status code is not 200 (Http okay)
-