public class HttpMultipartRestClient extends Object implements MultipartRestClient
Modifier and Type | Field and Description |
---|---|
protected org.apache.http.client.config.RequestConfig |
baseRequestConfig |
protected static org.apache.commons.logging.Log |
log |
protected RestClient |
rc |
Constructor and Description |
---|
HttpMultipartRestClient(org.apache.http.client.HttpClient httpClient)
Default constructor to create a new instance.
|
HttpMultipartRestClient(org.apache.http.client.HttpClient httpClient,
org.apache.http.client.config.RequestConfig requestConfig,
Session session)
An alternate constructor for special-case situations.
|
Modifier and Type | Method and Description |
---|---|
void |
closeIdleConnections()
Deprecated.
|
InputStream |
doDeleteRequest(String url,
Integer timeoutMillisecs) |
InputStream |
doGetRequest(String url,
Integer timeoutMillisecs)
Perform an HTTP GET request, setting the headers first and parsing /filtering
exceptions to the exception stream on the response into their
respective java instances.
|
InputStream |
doGetRequest(String url,
Integer timeoutMillisecs,
boolean allowRedirect) |
org.apache.http.Header[] |
doGetRequestForHeaders(String url,
Integer timeoutMillisecs) |
org.apache.http.Header[] |
doHeadRequest(String url,
Integer timeoutMillisecs) |
InputStream |
doPostRequest(String url,
SimpleMultipartEntity entity,
Integer timeoutMillisecs) |
InputStream |
doPutRequest(String url,
SimpleMultipartEntity entity,
Integer timeoutMillisecs) |
HashMap<String,String> |
getAddedHeaders() |
org.apache.http.client.HttpClient |
getHttpClient()
Gets the HttpClient instance used to make the connection
|
String |
getLatestRequestUrl()
Gets the string representation of the latest http call made by the
underlying RestClient
|
void |
setHeader(String name,
String value) |
protected static org.apache.commons.logging.Log log
protected RestClient rc
protected org.apache.http.client.config.RequestConfig baseRequestConfig
public HttpMultipartRestClient(org.apache.http.client.HttpClient httpClient)
public HttpMultipartRestClient(org.apache.http.client.HttpClient httpClient, org.apache.http.client.config.RequestConfig requestConfig, Session session)
httpClient
- requestConfig
- - set this parameter with the custom ReqeustConfig used
to build the HttpClient (v4.3.x or later), so per-request configurations can
use those configurations while at the same time overriding timeout ones.session
- - if using a v4.1.x httpClient (DefaultHttpClient), providing a
Session object sets up the SSL using the certificate associated with that session's subject.public org.apache.http.client.HttpClient getHttpClient()
public String getLatestRequestUrl()
getLatestRequestUrl
in interface MultipartRestClient
@Deprecated public void closeIdleConnections()
public InputStream doGetRequest(String url, Integer timeoutMillisecs) throws BaseException, ClientSideException
MultipartRestClient
doGetRequest
in interface MultipartRestClient
url
- - the encoded url stringBaseException
ClientSideException
public InputStream doGetRequest(String url, Integer timeoutMillisecs, boolean allowRedirect) throws BaseException, ClientSideException
doGetRequest
in interface MultipartRestClient
BaseException
ClientSideException
public org.apache.http.Header[] doGetRequestForHeaders(String url, Integer timeoutMillisecs) throws BaseException, ClientSideException
doGetRequestForHeaders
in interface MultipartRestClient
BaseException
ClientSideException
public InputStream doDeleteRequest(String url, Integer timeoutMillisecs) throws BaseException, ClientSideException
doDeleteRequest
in interface MultipartRestClient
BaseException
ClientSideException
public org.apache.http.Header[] doHeadRequest(String url, Integer timeoutMillisecs) throws BaseException, ClientSideException
doHeadRequest
in interface MultipartRestClient
BaseException
ClientSideException
public InputStream doPutRequest(String url, SimpleMultipartEntity entity, Integer timeoutMillisecs) throws BaseException, ClientSideException
doPutRequest
in interface MultipartRestClient
BaseException
ClientSideException
public InputStream doPostRequest(String url, SimpleMultipartEntity entity, Integer timeoutMillisecs) throws BaseException, ClientSideException
doPostRequest
in interface MultipartRestClient
BaseException
ClientSideException
Copyright © 2014. All Rights Reserved.