@Component public class HttpClientTemplate extends AbstractHttpClientTemplate<org.apache.commons.httpclient.methods.RequestEntity>
HttpClient
.authenticationPreemptive, client, connectionManager, defaultUri, lCredentials
Constructor and Description |
---|
HttpClientTemplate()
Constructor.
|
HttpClientTemplate(String defaultUri)
Constructor.
|
HttpClientTemplate(String defaultUri,
boolean init)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
executePostMethod(byte[] input)
Execute post method.
|
void |
executePostMethod(byte[] input,
ResponseCallback<?> callback)
Execute post method.
|
void |
executePostMethod(InputStream input)
Execute post method.
|
void |
executePostMethod(InputStream input,
ResponseCallback<?> callback)
Execute post method.
|
void |
executePostMethod(String input)
Execute post method.
|
void |
executePostMethod(String uri,
org.apache.commons.httpclient.methods.RequestEntity requestPayload,
Map<String,String> hParams,
ResponseCallback<?> callback)
Execute post method.
|
void |
executePostMethod(String input,
ResponseCallback<?> callback)
Execute post method.
|
protected void |
processHttpMethod(org.apache.commons.httpclient.HttpMethod httpMethod,
ResponseCallback<?> callback)
Processes
HttpMethod by executing the method,
validating the response, and calling the callback. |
afterPropertiesSet, destroy, executeGetMethod, executeGetMethod, executeGetMethod, executeGetMethod, executeGetMethod, executeGetMethod, executePostMethod, executePostMethod, executePostMethod, executePostMethod, executePostMethod, getClient, getConnectionManager, getCredentials, getDefaultUri, isAuthenticationPreemptive, processHttpMethodParams, setAuthenticationPreemptive, setClient, setConnectionManager, setCredentials, setDefaultUri, validateResponse
public HttpClientTemplate()
public HttpClientTemplate(String defaultUri)
defaultUri
- Default uri.public HttpClientTemplate(String defaultUri, boolean init)
defaultUri
- Default uri.init
- Whether or not to initialize the bean.public void executePostMethod(byte[] input)
input
- Byte array RequestEntity
to post
for the request's data.public void executePostMethod(byte[] input, ResponseCallback<?> callback)
input
- Byte array RequestEntity
to post
for the request's data.callback
- Callback with HTTP method's response.public void executePostMethod(String input)
input
- String
to post
for the request's data.public void executePostMethod(String input, ResponseCallback<?> callback)
input
- String
to post
for the request's data.callback
- Callback with HTTP method's response.public void executePostMethod(InputStream input)
input
- InputStream
to post
for the request's data.public void executePostMethod(InputStream input, ResponseCallback<?> callback)
input
- InputStream
to post
for the request's data.callback
- Callback with HTTP method's response.public void executePostMethod(String uri, org.apache.commons.httpclient.methods.RequestEntity requestPayload, Map<String,String> hParams, ResponseCallback<?> callback)
executePostMethod
in class AbstractHttpClientTemplate<org.apache.commons.httpclient.methods.RequestEntity>
uri
- URI to use when processing this HTTP request instead
of using the default URI.requestPayload
- RequestEntity
data to post.hParams
- Parameters for the HTTP post.callback
- Callback with HTTP method's response.protected void processHttpMethod(org.apache.commons.httpclient.HttpMethod httpMethod, ResponseCallback<?> callback)
HttpMethod
by executing the method,
validating the response, and calling the callback.processHttpMethod
in class AbstractHttpClientTemplate<org.apache.commons.httpclient.methods.RequestEntity>
httpMethod
- HttpMethod
to process.callback
- Callback with HTTP method's response.Copyright © 2008-2013 Spring by Example. All Rights Reserved.