# Package org.springframework.web.client

@NonNullApi @NonNullFields package org.springframework.web.client
Core package of the client-side web support. Provides the RestTemplate and RestClient.

Related Packages
Package
Description
org.springframework.web
Common, generic interfaces that define minimal boundary points between Spring's web infrastructure and other framework modules.
org.springframework.web.client.support
Classes supporting the `org.springframework.web.client` package.
Class
Description
DefaultResponseErrorHandler
Spring's default implementation of the `ResponseErrorHandler` interface.
ExtractingResponseErrorHandler
Implementation of `ResponseErrorHandler` that uses `HttpMessageConverters` to convert HTTP error responses to `RestClientExceptions`.
HttpClientErrorException
Exception thrown when an HTTP 4xx is received.
HttpClientErrorException.BadRequest
`HttpClientErrorException` for status HTTP 400 Bad Request.
HttpClientErrorException.Conflict
`HttpClientErrorException` for status HTTP 409 Conflict.
HttpClientErrorException.Forbidden
`HttpClientErrorException` for status HTTP 403 Forbidden.
HttpClientErrorException.Gone
`HttpClientErrorException` for status HTTP 410 Gone.
HttpClientErrorException.MethodNotAllowed
`HttpClientErrorException` for status HTTP 405 Method Not Allowed.
HttpClientErrorException.NotAcceptable
`HttpClientErrorException` for status HTTP 406 Not Acceptable.
HttpClientErrorException.NotFound
`HttpClientErrorException` for status HTTP 404 Not Found.
HttpClientErrorException.TooManyRequests
`HttpClientErrorException` for status HTTP 429 Too Many Requests.
HttpClientErrorException.Unauthorized
`HttpClientErrorException` for status HTTP 401 Unauthorized.
HttpClientErrorException.UnprocessableEntity
`HttpClientErrorException` for status HTTP 422 Unprocessable Entity.
HttpClientErrorException.UnsupportedMediaType
`HttpClientErrorException` for status HTTP 415 Unsupported Media Type.
HttpMessageConverterExtractor<T>
Response extractor that uses the given entity converters to convert the response into a type `T`.
HttpServerErrorException
Exception thrown when an HTTP 5xx is received.
HttpServerErrorException.BadGateway
`HttpServerErrorException` for HTTP status 502 Bad Gateway.
HttpServerErrorException.GatewayTimeout
`HttpServerErrorException` for status HTTP 504 Gateway Timeout.
HttpServerErrorException.InternalServerError
`HttpServerErrorException` for status HTTP 500 Internal Server Error.
HttpServerErrorException.NotImplemented
`HttpServerErrorException` for status HTTP 501 Not Implemented.
HttpServerErrorException.ServiceUnavailable
`HttpServerErrorException` for status HTTP 503 Service Unavailable.
HttpStatusCodeException
Abstract base class for exceptions based on an `HttpStatusCode`.
NoOpResponseErrorHandler
A basic, no operation `ResponseErrorHandler` implementation suitable for ignoring any error using the `RestTemplate` or `RestClient`.
RequestCallback
Callback interface for code that operates on a `ClientHttpRequest`.
ResourceAccessException
Exception thrown when an I/O error occurs.
ResponseErrorHandler
Strategy interface used by the `RestTemplate` and `RestClient` to determine whether a particular response has an error or not.
ResponseExtractor<T>
Generic callback interface used by `RestTemplate`'s retrieval methods.
RestClient
Client to perform HTTP requests, exposing a fluent, synchronous API over underlying HTTP client libraries such as the JDK `HttpClient`, Apache HttpComponents, and others.
RestClient.Builder
A mutable builder for creating a `RestClient`.
RestClient.RequestBodySpec
Contract for specifying request headers and body leading up to the exchange.
RestClient.RequestBodyUriSpec
Contract for specifying request headers, body and URI for a request.
RestClient.RequestHeadersSpec<S extends RestClient.RequestHeadersSpec<S>>
Contract for specifying request headers leading up to the exchange.
RestClient.RequestHeadersSpec.ConvertibleClientHttpResponse
Extension of `ClientHttpResponse` that can convert the body.
RestClient.RequestHeadersSpec.ExchangeFunction<T>
Defines the contract for `RestClient.RequestHeadersSpec.exchange(ExchangeFunction)`.
RestClient.RequestHeadersSpec.RequiredValueExchangeFunction<T>
Variant of `RestClient.RequestHeadersSpec.ExchangeFunction` returning a non-null required value.
RestClient.RequestHeadersUriSpec<S extends RestClient.RequestHeadersSpec<S>>
Contract for specifying request headers and URI for a request.
RestClient.ResponseSpec
Contract for specifying response operations following the exchange.
RestClient.ResponseSpec.ErrorHandler
Used in `RestClient.ResponseSpec.onStatus(Predicate, ErrorHandler)`.
RestClient.UriSpec<S extends RestClient.RequestHeadersSpec<?>>
Contract for specifying the URI for a request.
RestClientException
Base class for exceptions thrown by `RestClient` and `RestTemplate` in case a request fails because of a server error response, a 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 JDK `HttpURLConnection`, Apache HttpComponents, and others.
UnknownContentTypeException
Raised when no suitable `HttpMessageConverter` could be found to extract the response.
UnknownHttpStatusCodeException
Exception thrown when an unknown (or custom) HTTP status code is received.