org.springframework.http.client
Class CommonsClientHttpRequest
java.lang.Object
org.springframework.http.client.AbstractClientHttpRequest
org.springframework.http.client.CommonsClientHttpRequest
- All Implemented Interfaces:
- ClientHttpRequest, HttpMessage, HttpOutputMessage
final class CommonsClientHttpRequest
- extends AbstractClientHttpRequest
ClientHttpRequest
implementation that uses
Apache Commons HttpClient to execute requests.
Created via the CommonsClientHttpRequestFactory
.
- Since:
- 3.0
- Author:
- Arjen Poutsma
- See Also:
CommonsClientHttpRequestFactory.createRequest(java.net.URI, HttpMethod)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
httpClient
private final HttpClient httpClient
httpMethod
private final HttpMethodBase httpMethod
CommonsClientHttpRequest
CommonsClientHttpRequest(HttpClient httpClient,
HttpMethodBase httpMethod)
getMethod
public HttpMethod getMethod()
- Description copied from interface:
ClientHttpRequest
- Return the HTTP method of the request.
- Returns:
- the HTTP method as an HttpMethod enum value
getURI
public java.net.URI getURI()
- Description copied from interface:
ClientHttpRequest
- Return the URI of the request.
- Returns:
- the URI of the request
executeInternal
public ClientHttpResponse executeInternal(HttpHeaders headers,
byte[] output)
throws java.io.IOException
- Description copied from class:
AbstractClientHttpRequest
- Abstract template method that writes the given headers and content to the HTTP request.
- Specified by:
executeInternal
in class AbstractClientHttpRequest
- Parameters:
headers
- the HTTP headersoutput
- the body content
- Returns:
- the response object for the executed request
- Throws:
java.io.IOException