程序包的使用
org.springframework.web.client
使用org.springframework.web.client的程序包 程序包 说明 org.springframework.test.web.client Contains client-side REST testing support.org.springframework.web.client Core package of the client-side web support.org.springframework.web.client.support Classes supporting theorg.springframework.web.client
package.org.springframework.web.socket.sockjs.client SockJS client implementation ofWebSocketClient
.org.springframework.test.web.client使用的org.springframework.web.client中的类 类 说明 AsyncRestTemplate 已过时。as of Spring 5.0, in favor ofWebClient
RestTemplate Synchronous client to perform HTTP requests, exposing a simple, template method API over underlying HTTP client libraries such as the JDKHttpURLConnection
, Apache HttpComponents, and others.org.springframework.web.client使用的org.springframework.web.client中的类 类 说明 AsyncRequestCallback 已过时。as of Spring 5.0, in favor ofExchangeFilterFunction
AsyncRestOperations 已过时。as of Spring 5.0, in favor ofWebClient
DefaultResponseErrorHandler Spring's default implementation of theResponseErrorHandler
interface.HttpClientErrorException Exception thrown when an HTTP 4xx is received.HttpServerErrorException Exception thrown when an HTTP 5xx is received.HttpStatusCodeException Abstract base class for exceptions based on anHttpStatus
.RequestCallback Callback interface for code that operates on aClientHttpRequest
.ResponseErrorHandler Strategy interface used by theRestTemplate
to determine whether a particular response has an error or not.ResponseExtractor Generic callback interface used byRestTemplate
's retrieval methods Implementations of this interface perform the actual work of extracting data from aClientHttpResponse
, but don't need to worry about exception handling or closing resources.RestClientException Base class for exceptions thrown byRestTemplate
in case a request fails because of a server error response, as determined viaResponseErrorHandler.hasError(ClientHttpResponse)
, failure to decode the response, or a low level I/O error.RestClientResponseException Common base class for exceptions that contain actual HTTP response data.RestOperations Interface specifying a basic set of RESTful operations.RestTemplate Synchronous client to perform HTTP requests, exposing a simple, template method API over underlying HTTP client libraries such as the JDKHttpURLConnection
, Apache HttpComponents, and others.org.springframework.web.client.support使用的org.springframework.web.client中的类 类 说明 RestTemplate Synchronous client to perform HTTP requests, exposing a simple, template method API over underlying HTTP client libraries such as the JDKHttpURLConnection
, Apache HttpComponents, and others.org.springframework.web.socket.sockjs.client使用的org.springframework.web.client中的类 类 说明 RestOperations Interface specifying a basic set of RESTful operations.