public class HttpConnector extends java.lang.Object implements Connector
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
VERSION |
| Constructor and Description |
|---|
HttpConnector() |
| Modifier and Type | Method and Description |
|---|---|
RawResponse |
doRequest(RawRequest request,
ConnectionData cd)
Send the raw request using the given connection data.
|
protected java.net.HttpURLConnection |
openConnection(HttpConnectionData connectionData)
Opens the connection.
|
protected void |
prepareConnection(java.net.HttpURLConnection connection,
BasicHttpAuthorization authorization,
int postDataLength)
Initializes common connection settings.
|
public static final java.lang.String VERSION
public RawResponse doRequest(RawRequest request, ConnectionData cd)
Connectorprotected java.net.HttpURLConnection openConnection(HttpConnectionData connectionData) throws java.io.IOException
connectionData - connection data with target URL the connection will be opened
to.java.io.IOException - thrown on call of URL.openConnection()protected void prepareConnection(java.net.HttpURLConnection connection,
BasicHttpAuthorization authorization,
int postDataLength)
throws java.net.ProtocolException
connection - opened HTTP connectionauthorization - the basic HTTP authorizationpostDataLength - the length of the data to be posted, used for setting the
proper value of the Content-Length headerjava.net.ProtocolException - thrown exception on wrong call of
HttpURLConnection.setRequestMethod(String)