Package | Description |
---|---|
org.springframework.http.client |
Contains an abstraction over client-side HTTP.
|
org.springframework.http.client.support |
This package provides generic HTTP support classes,
to be used by higher-level classes like RestTemplate.
|
org.springframework.mock.http.client |
Mock implementations of client-side HTTP abstractions.
|
org.springframework.test.web.client |
Contains client-side REST testing support.
|
org.springframework.test.web.client.response |
Contains built-in
ResponseCreator
implementations. |
org.springframework.web.client |
Core package of the client-side web support.
|
Modifier and Type | Class and Description |
---|---|
class |
AbstractClientHttpResponse
Abstract base for
ClientHttpResponse . |
Modifier and Type | Method and Description |
---|---|
ClientHttpResponse |
ClientHttpRequest.execute()
Execute this request, resulting in a
ClientHttpResponse that can be read. |
ClientHttpResponse |
AbstractClientHttpRequest.execute() |
ClientHttpResponse |
ClientHttpRequestExecution.execute(HttpRequest request,
byte[] body)
Execute the request with the given request attributes and body,
and return the response.
|
protected abstract ClientHttpResponse |
AbstractClientHttpRequest.executeInternal(HttpHeaders headers)
Abstract template method that writes the given headers and content to the HTTP request.
|
ClientHttpResponse |
ClientHttpRequestInterceptor.intercept(HttpRequest request,
byte[] body,
ClientHttpRequestExecution execution)
Intercept the given request, and return a response.
|
Modifier and Type | Method and Description |
---|---|
ListenableFuture<ClientHttpResponse> |
AsyncClientHttpRequest.executeAsync()
Deprecated.
Execute this request asynchronously, resulting in a Future handle.
|
ListenableFuture<ClientHttpResponse> |
AsyncClientHttpRequestExecution.executeAsync(HttpRequest request,
byte[] body)
Deprecated.
Resume the request execution by invoking the next interceptor in the chain
or executing the request to the remote service.
|
ListenableFuture<ClientHttpResponse> |
AsyncClientHttpRequestInterceptor.intercept(HttpRequest request,
byte[] body,
AsyncClientHttpRequestExecution execution)
Deprecated.
Intercept the given request, and return a response future.
|
Modifier and Type | Method and Description |
---|---|
ClientHttpResponse |
BasicAuthorizationInterceptor.intercept(HttpRequest request,
byte[] body,
ClientHttpRequestExecution execution)
Deprecated.
|
ClientHttpResponse |
BasicAuthenticationInterceptor.intercept(HttpRequest request,
byte[] body,
ClientHttpRequestExecution execution) |
Modifier and Type | Class and Description |
---|---|
class |
MockClientHttpResponse
Mock implementation of
ClientHttpResponse . |
Modifier and Type | Method and Description |
---|---|
ClientHttpResponse |
MockClientHttpRequest.execute()
|
protected ClientHttpResponse |
MockClientHttpRequest.executeInternal()
The default implementation returns the configured
response . |
Modifier and Type | Method and Description |
---|---|
ListenableFuture<ClientHttpResponse> |
MockAsyncClientHttpRequest.executeAsync()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
MockClientHttpRequest.setResponse(ClientHttpResponse clientHttpResponse) |
Modifier and Type | Method and Description |
---|---|
ClientHttpResponse |
DefaultRequestExpectation.createResponse(ClientHttpRequest request)
Note that as of 5.0.3, the creation of the response, which may block
intentionally, is separated from request count tracking, and this
method no longer increments the count transparently.
|
ClientHttpResponse |
ResponseCreator.createResponse(ClientHttpRequest request)
Create a response for the given request.
|
ClientHttpResponse |
RequestExpectationManager.validateRequest(ClientHttpRequest request)
Validate the given actual request against the declared expectations.
|
ClientHttpResponse |
AbstractRequestExpectationManager.validateRequest(ClientHttpRequest request) |
protected ClientHttpResponse |
AbstractRequestExpectationManager.validateRequestInternal(ClientHttpRequest request)
Deprecated.
as of 5.0.3, subclasses should implement
AbstractRequestExpectationManager.matchRequest(ClientHttpRequest)
instead and return only the matched expectation, leaving the call to create the response
as a separate step (to be invoked by this class). |
Modifier and Type | Method and Description |
---|---|
ClientHttpResponse |
DefaultResponseCreator.createResponse(ClientHttpRequest request) |
Modifier and Type | Method and Description |
---|---|
T |
ResponseExtractor.extractData(ClientHttpResponse response)
Extract data from the given
ClientHttpResponse and return it. |
T |
HttpMessageConverterExtractor.extractData(ClientHttpResponse response) |
protected Charset |
DefaultResponseErrorHandler.getCharset(ClientHttpResponse response)
Determine the charset of the response (for inclusion in a status exception).
|
protected MediaType |
HttpMessageConverterExtractor.getContentType(ClientHttpResponse response)
Determine the Content-Type of the response based on the "Content-Type"
header or otherwise default to
MediaType.APPLICATION_OCTET_STREAM . |
protected HttpStatus |
DefaultResponseErrorHandler.getHttpStatusCode(ClientHttpResponse response)
Deprecated.
as of 5.0, in favor of
DefaultResponseErrorHandler.handleError(ClientHttpResponse, HttpStatus) |
protected byte[] |
DefaultResponseErrorHandler.getResponseBody(ClientHttpResponse response)
Read the body of the given response (for inclusion in a status exception).
|
void |
DefaultResponseErrorHandler.handleError(ClientHttpResponse response)
Handle the error in the given response with the given resolved status code.
|
void |
ResponseErrorHandler.handleError(ClientHttpResponse response)
Handle the error in the given response.
|
void |
ExtractingResponseErrorHandler.handleError(ClientHttpResponse response,
HttpStatus statusCode) |
protected void |
DefaultResponseErrorHandler.handleError(ClientHttpResponse response,
HttpStatus statusCode)
Handle the error based on the resolved status code.
|
default void |
ResponseErrorHandler.handleError(URI url,
HttpMethod method,
ClientHttpResponse response)
Alternative to
ResponseErrorHandler.handleError(ClientHttpResponse) with extra
information providing access to the request URL and HTTP method. |
protected void |
RestTemplate.handleResponse(URI url,
HttpMethod method,
ClientHttpResponse response)
Handle the given response, performing appropriate logging and
invoking the
ResponseErrorHandler if necessary. |
boolean |
DefaultResponseErrorHandler.hasError(ClientHttpResponse response)
Delegates to
DefaultResponseErrorHandler.hasError(HttpStatus) (for a standard status enum value) or
DefaultResponseErrorHandler.hasError(int) (for an unknown status code) with the response status code. |
boolean |
ResponseErrorHandler.hasError(ClientHttpResponse response)
Indicate whether the given response has any errors.
|