Uses of Class
org.springframework.http.ResponseEntity
Package
Description
Contains a basic abstraction over client/server-side HTTP.
Core package of the client-side web support.
Provides a reactive
WebClient
that builds on top of the
org.springframework.http.client.reactive
reactive HTTP adapter layer.Classes supporting the
org.springframework.web.reactive.function.client
package.Infrastructure for annotation-based handler method processing.
Support for creating a client proxy for an HTTP service annotated with
HttpExchange
methods.MVC infrastructure for annotation-based handler method processing, building on the
org.springframework.web.method.annotation
package.SockJS client implementation of
WebSocketClient
.-
Uses of ResponseEntity in org.springframework.http
Modifier and TypeMethodDescription<T> ResponseEntity<T>
ResponseEntity.BodyBuilder.body
(T body) Set the body of the response entity and returns it.<T> ResponseEntity<T>
ResponseEntity.HeadersBuilder.build()
Build the response entity with no body.static <T> ResponseEntity<T>
A shortcut for creating aResponseEntity
with the given body and the OK status, or an empty body and a NOT FOUND status in case of an Optional.empty() parameter.static <T> ResponseEntity<T>
ResponseEntity.ofNullable
(T body) static <T> ResponseEntity<T>
ResponseEntity.ok
(T body) A shortcut for creating aResponseEntity
with the given body and the status set to OK. -
Uses of ResponseEntity in org.springframework.web.client
Modifier and TypeMethodDescription<T> ResponseEntity<T>
RestOperations.exchange
(String url, HttpMethod method, HttpEntity<?> requestEntity, Class<T> responseType, Object... uriVariables) Execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response asResponseEntity
.<T> ResponseEntity<T>
RestOperations.exchange
(String url, HttpMethod method, HttpEntity<?> requestEntity, Class<T> responseType, Map<String, ?> uriVariables) Execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response asResponseEntity
.<T> ResponseEntity<T>
RestOperations.exchange
(String url, HttpMethod method, HttpEntity<?> requestEntity, ParameterizedTypeReference<T> responseType, Object... uriVariables) Execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response asResponseEntity
.<T> ResponseEntity<T>
RestOperations.exchange
(String url, HttpMethod method, HttpEntity<?> requestEntity, ParameterizedTypeReference<T> responseType, Map<String, ?> uriVariables) Execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response asResponseEntity
.<T> ResponseEntity<T>
RestOperations.exchange
(URI url, HttpMethod method, HttpEntity<?> requestEntity, Class<T> responseType) Execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response asResponseEntity
.<T> ResponseEntity<T>
RestOperations.exchange
(URI url, HttpMethod method, HttpEntity<?> requestEntity, ParameterizedTypeReference<T> responseType) Execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response asResponseEntity
.<T> ResponseEntity<T>
RestOperations.exchange
(RequestEntity<?> requestEntity, Class<T> responseType) Execute the request specified in the givenRequestEntity
and return the response asResponseEntity
.<T> ResponseEntity<T>
RestOperations.exchange
(RequestEntity<?> requestEntity, ParameterizedTypeReference<T> responseType) Execute the request specified in the givenRequestEntity
and return the response asResponseEntity
.<T> ResponseEntity<T>
RestTemplate.exchange
(String url, HttpMethod method, HttpEntity<?> requestEntity, Class<T> responseType, Object... uriVariables) <T> ResponseEntity<T>
RestTemplate.exchange
(String url, HttpMethod method, HttpEntity<?> requestEntity, Class<T> responseType, Map<String, ?> uriVariables) <T> ResponseEntity<T>
RestTemplate.exchange
(String url, HttpMethod method, HttpEntity<?> requestEntity, ParameterizedTypeReference<T> responseType, Object... uriVariables) <T> ResponseEntity<T>
RestTemplate.exchange
(String url, HttpMethod method, HttpEntity<?> requestEntity, ParameterizedTypeReference<T> responseType, Map<String, ?> uriVariables) <T> ResponseEntity<T>
RestTemplate.exchange
(URI url, HttpMethod method, HttpEntity<?> requestEntity, Class<T> responseType) <T> ResponseEntity<T>
RestTemplate.exchange
(URI url, HttpMethod method, HttpEntity<?> requestEntity, ParameterizedTypeReference<T> responseType) <T> ResponseEntity<T>
RestTemplate.exchange
(RequestEntity<?> entity, Class<T> responseType) <T> ResponseEntity<T>
RestTemplate.exchange
(RequestEntity<?> entity, ParameterizedTypeReference<T> responseType) <T> ResponseEntity<T>
RestOperations.getForEntity
(String url, Class<T> responseType, Object... uriVariables) Retrieve an entity by doing a GET on the specified URL.<T> ResponseEntity<T>
RestOperations.getForEntity
(String url, Class<T> responseType, Map<String, ?> uriVariables) Retrieve a representation by doing a GET on the URI template.<T> ResponseEntity<T>
RestOperations.getForEntity
(URI url, Class<T> responseType) Retrieve a representation by doing a GET on the URL.<T> ResponseEntity<T>
RestTemplate.getForEntity
(String url, Class<T> responseType, Object... uriVariables) <T> ResponseEntity<T>
RestTemplate.getForEntity
(String url, Class<T> responseType, Map<String, ?> uriVariables) <T> ResponseEntity<T>
RestTemplate.getForEntity
(URI url, Class<T> responseType) <T> ResponseEntity<T>
RestOperations.postForEntity
(String url, Object request, Class<T> responseType, Object... uriVariables) Create a new resource by POSTing the given object to the URI template, and returns the response asResponseEntity
.<T> ResponseEntity<T>
RestOperations.postForEntity
(String url, Object request, Class<T> responseType, Map<String, ?> uriVariables) Create a new resource by POSTing the given object to the URI template, and returns the response asHttpEntity
.<T> ResponseEntity<T>
RestOperations.postForEntity
(URI url, Object request, Class<T> responseType) Create a new resource by POSTing the given object to the URL, and returns the response asResponseEntity
.<T> ResponseEntity<T>
RestTemplate.postForEntity
(String url, Object request, Class<T> responseType, Object... uriVariables) <T> ResponseEntity<T>
RestTemplate.postForEntity
(String url, Object request, Class<T> responseType, Map<String, ?> uriVariables) <T> ResponseEntity<T>
RestTemplate.postForEntity
(URI url, Object request, Class<T> responseType) Modifier and TypeMethodDescription<T> ResponseExtractor<ResponseEntity<T>>
RestTemplate.responseEntityExtractor
(Type responseType) Return aResponseExtractor
that prepares aResponseEntity
. -
Uses of ResponseEntity in org.springframework.web.reactive.function.client
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<ResponseEntity<Void>>
ClientResponse.toBodilessEntity()
Return this response as a delayedResponseEntity
containing status and headers, but no body.reactor.core.publisher.Mono<ResponseEntity<Void>>
WebClient.ResponseSpec.toBodilessEntity()
Return aResponseEntity
without a body.<T> reactor.core.publisher.Mono<ResponseEntity<T>>
Return this response as a delayedResponseEntity
.<T> reactor.core.publisher.Mono<ResponseEntity<T>>
ClientResponse.toEntity
(ParameterizedTypeReference<T> bodyTypeReference) Return this response as a delayedResponseEntity
.<T> reactor.core.publisher.Mono<ResponseEntity<T>>
Return aResponseEntity
with the body decoded to an Object of the given type.<T> reactor.core.publisher.Mono<ResponseEntity<T>>
WebClient.ResponseSpec.toEntity
(ParameterizedTypeReference<T> bodyTypeReference) Variant ofWebClient.ResponseSpec.bodyToMono(Class)
with aParameterizedTypeReference
.<T> reactor.core.publisher.Mono<ResponseEntity<reactor.core.publisher.Flux<T>>>
WebClient.ResponseSpec.toEntityFlux
(Class<T> elementType) Return aResponseEntity
with the body decoded to aFlux
of elements of the given type.<T> reactor.core.publisher.Mono<ResponseEntity<reactor.core.publisher.Flux<T>>>
WebClient.ResponseSpec.toEntityFlux
(ParameterizedTypeReference<T> elementTypeReference) Variant ofWebClient.ResponseSpec.toEntityFlux(Class)
with aParameterizedTypeReference
.<T> reactor.core.publisher.Mono<ResponseEntity<reactor.core.publisher.Flux<T>>>
WebClient.ResponseSpec.toEntityFlux
(BodyExtractor<reactor.core.publisher.Flux<T>, ? super ClientHttpResponse> bodyExtractor) Variant ofWebClient.ResponseSpec.toEntityFlux(Class)
with aBodyExtractor
.<T> reactor.core.publisher.Mono<ResponseEntity<List<T>>>
ClientResponse.toEntityList
(Class<T> elementClass) Return this response as a delayed list ofResponseEntity
s.<T> reactor.core.publisher.Mono<ResponseEntity<List<T>>>
ClientResponse.toEntityList
(ParameterizedTypeReference<T> elementTypeRef) Return this response as a delayed list ofResponseEntity
s.<T> reactor.core.publisher.Mono<ResponseEntity<List<T>>>
WebClient.ResponseSpec.toEntityList
(Class<T> elementClass) Return aResponseEntity
with the body decoded to aList
of elements of the given type.<T> reactor.core.publisher.Mono<ResponseEntity<List<T>>>
WebClient.ResponseSpec.toEntityList
(ParameterizedTypeReference<T> elementTypeRef) Variant ofWebClient.ResponseSpec.toEntity(Class)
with aParameterizedTypeReference
. -
Uses of ResponseEntity in org.springframework.web.reactive.function.client.support
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<ResponseEntity<Void>>
WebClientAdapter.requestToBodilessEntity
(HttpRequestValues requestValues) <T> reactor.core.publisher.Mono<ResponseEntity<T>>
WebClientAdapter.requestToEntity
(HttpRequestValues requestValues, ParameterizedTypeReference<T> bodyType) <T> reactor.core.publisher.Mono<ResponseEntity<reactor.core.publisher.Flux<T>>>
WebClientAdapter.requestToEntityFlux
(HttpRequestValues requestValues, ParameterizedTypeReference<T> bodyType) reactor.core.publisher.Mono<ResponseEntity<Void>>
ClientResponseWrapper.toBodilessEntity()
<T> reactor.core.publisher.Mono<ResponseEntity<T>>
<T> reactor.core.publisher.Mono<ResponseEntity<T>>
ClientResponseWrapper.toEntity
(ParameterizedTypeReference<T> bodyTypeReference) <T> reactor.core.publisher.Mono<ResponseEntity<List<T>>>
ClientResponseWrapper.toEntityList
(Class<T> elementClass) <T> reactor.core.publisher.Mono<ResponseEntity<List<T>>>
ClientResponseWrapper.toEntityList
(ParameterizedTypeReference<T> elementTypeRef) -
Uses of ResponseEntity in org.springframework.web.reactive.result.method.annotation
Modifier and TypeMethodDescriptionprotected reactor.core.publisher.Mono<ResponseEntity<Object>>
ResponseEntityExceptionHandler.createResponseEntity
(Object body, HttpHeaders headers, HttpStatusCode status, ServerWebExchange exchange) Create theResponseEntity
to use from the given body, headers, and statusCode.protected reactor.core.publisher.Mono<ResponseEntity<Object>>
ResponseEntityExceptionHandler.handleErrorResponseException
(ErrorResponseException ex, HttpHeaders headers, HttpStatusCode status, ServerWebExchange exchange) Customize the handling of anyErrorResponseException
.final reactor.core.publisher.Mono<ResponseEntity<Object>>
ResponseEntityExceptionHandler.handleException
(Exception ex, ServerWebExchange exchange) Handle all exceptions raised within Spring MVC handling of the request.protected reactor.core.publisher.Mono<ResponseEntity<Object>>
ResponseEntityExceptionHandler.handleExceptionInternal
(Exception ex, Object body, HttpHeaders headers, HttpStatusCode status, ServerWebExchange exchange) Internal handler method that all others in this class delegate to, for common handling, and for the creation of aResponseEntity
.protected reactor.core.publisher.Mono<ResponseEntity<Object>>
ResponseEntityExceptionHandler.handleMethodNotAllowedException
(MethodNotAllowedException ex, HttpHeaders headers, HttpStatusCode status, ServerWebExchange exchange) Customize the handling ofMethodNotAllowedException
.protected reactor.core.publisher.Mono<ResponseEntity<Object>>
ResponseEntityExceptionHandler.handleMissingRequestValueException
(MissingRequestValueException ex, HttpHeaders headers, HttpStatusCode status, ServerWebExchange exchange) Customize the handling ofMissingRequestValueException
.protected reactor.core.publisher.Mono<ResponseEntity<Object>>
ResponseEntityExceptionHandler.handleNotAcceptableStatusException
(NotAcceptableStatusException ex, HttpHeaders headers, HttpStatusCode status, ServerWebExchange exchange) Customize the handling ofNotAcceptableStatusException
.protected reactor.core.publisher.Mono<ResponseEntity<Object>>
ResponseEntityExceptionHandler.handleResponseStatusException
(ResponseStatusException ex, HttpHeaders headers, HttpStatusCode status, ServerWebExchange exchange) Customize the handling of anyResponseStatusException
.protected reactor.core.publisher.Mono<ResponseEntity<Object>>
ResponseEntityExceptionHandler.handleServerErrorException
(ServerErrorException ex, HttpHeaders headers, HttpStatusCode status, ServerWebExchange exchange) Customize the handling ofServerErrorException
.protected reactor.core.publisher.Mono<ResponseEntity<Object>>
ResponseEntityExceptionHandler.handleServerWebInputException
(ServerWebInputException ex, HttpHeaders headers, HttpStatusCode status, ServerWebExchange exchange) Customize the handling ofServerWebInputException
.protected reactor.core.publisher.Mono<ResponseEntity<Object>>
ResponseEntityExceptionHandler.handleUnsatisfiedRequestParameterException
(UnsatisfiedRequestParameterException ex, HttpHeaders headers, HttpStatusCode status, ServerWebExchange exchange) Customize the handling ofUnsatisfiedRequestParameterException
.protected reactor.core.publisher.Mono<ResponseEntity<Object>>
ResponseEntityExceptionHandler.handleUnsupportedMediaTypeStatusException
(UnsupportedMediaTypeStatusException ex, HttpHeaders headers, HttpStatusCode status, ServerWebExchange exchange) Customize the handling ofUnsupportedMediaTypeStatusException
.protected reactor.core.publisher.Mono<ResponseEntity<Object>>
ResponseEntityExceptionHandler.handleWebExchangeBindException
(WebExchangeBindException ex, HttpHeaders headers, HttpStatusCode status, ServerWebExchange exchange) Customize the handling ofWebExchangeBindException
. -
Uses of ResponseEntity in org.springframework.web.service.invoker
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<ResponseEntity<Void>>
HttpClientAdapter.requestToBodilessEntity
(HttpRequestValues requestValues) Variant ofHttpClientAdapter.requestToVoid(HttpRequestValues)
with additional access to the response status and headers.<T> reactor.core.publisher.Mono<ResponseEntity<T>>
HttpClientAdapter.requestToEntity
(HttpRequestValues requestValues, ParameterizedTypeReference<T> bodyType) Variant ofHttpClientAdapter.requestToBody(HttpRequestValues, ParameterizedTypeReference)
with additional access to the response status and headers.<T> reactor.core.publisher.Mono<ResponseEntity<reactor.core.publisher.Flux<T>>>
HttpClientAdapter.requestToEntityFlux
(HttpRequestValues requestValues, ParameterizedTypeReference<T> bodyType) Variant ofHttpClientAdapter.requestToBodyFlux(HttpRequestValues, ParameterizedTypeReference)
with additional access to the response status and headers. -
Uses of ResponseEntity in org.springframework.web.servlet.mvc.method.annotation
Modifier and TypeMethodDescriptionprotected ResponseEntity<Object>
ResponseEntityExceptionHandler.createResponseEntity
(Object body, HttpHeaders headers, HttpStatusCode statusCode, WebRequest request) Create theResponseEntity
to use from the given body, headers, and statusCode.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleAsyncRequestTimeoutException
(AsyncRequestTimeoutException ex, HttpHeaders headers, HttpStatusCode status, WebRequest request) Customize the handling ofAsyncRequestTimeoutException
.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleBindException
(BindException ex, HttpHeaders headers, HttpStatusCode status, WebRequest request) Deprecated, for removal: This API element is subject to removal in a future version.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleConversionNotSupported
(ConversionNotSupportedException ex, HttpHeaders headers, HttpStatusCode status, WebRequest request) Customize the handling ofConversionNotSupportedException
.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleErrorResponseException
(ErrorResponseException ex, HttpHeaders headers, HttpStatusCode status, WebRequest request) Customize the handling of anyErrorResponseException
.final ResponseEntity<Object>
ResponseEntityExceptionHandler.handleException
(Exception ex, WebRequest request) Handle all exceptions raised within Spring MVC handling of the request.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleExceptionInternal
(Exception ex, Object body, HttpHeaders headers, HttpStatusCode statusCode, WebRequest request) Internal handler method that all others in this class delegate to, for common handling, and for the creation of aResponseEntity
.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleHttpMediaTypeNotAcceptable
(HttpMediaTypeNotAcceptableException ex, HttpHeaders headers, HttpStatusCode status, WebRequest request) Customize the handling ofHttpMediaTypeNotAcceptableException
.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleHttpMediaTypeNotSupported
(HttpMediaTypeNotSupportedException ex, HttpHeaders headers, HttpStatusCode status, WebRequest request) Customize the handling ofHttpMediaTypeNotSupportedException
.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleHttpMessageNotReadable
(HttpMessageNotReadableException ex, HttpHeaders headers, HttpStatusCode status, WebRequest request) Customize the handling ofHttpMessageNotReadableException
.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleHttpMessageNotWritable
(HttpMessageNotWritableException ex, HttpHeaders headers, HttpStatusCode status, WebRequest request) Customize the handling ofHttpMessageNotWritableException
.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleHttpRequestMethodNotSupported
(HttpRequestMethodNotSupportedException ex, HttpHeaders headers, HttpStatusCode status, WebRequest request) Customize the handling ofHttpRequestMethodNotSupportedException
.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleMethodArgumentNotValid
(MethodArgumentNotValidException ex, HttpHeaders headers, HttpStatusCode status, WebRequest request) Customize the handling ofMethodArgumentNotValidException
.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleMissingPathVariable
(MissingPathVariableException ex, HttpHeaders headers, HttpStatusCode status, WebRequest request) Customize the handling ofMissingPathVariableException
.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleMissingServletRequestParameter
(MissingServletRequestParameterException ex, HttpHeaders headers, HttpStatusCode status, WebRequest request) Customize the handling ofMissingServletRequestParameterException
.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleMissingServletRequestPart
(MissingServletRequestPartException ex, HttpHeaders headers, HttpStatusCode status, WebRequest request) Customize the handling ofMissingServletRequestPartException
.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleNoHandlerFoundException
(NoHandlerFoundException ex, HttpHeaders headers, HttpStatusCode status, WebRequest request) Customize the handling ofNoHandlerFoundException
.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleServletRequestBindingException
(ServletRequestBindingException ex, HttpHeaders headers, HttpStatusCode status, WebRequest request) Customize the handling ofServletRequestBindingException
.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleTypeMismatch
(TypeMismatchException ex, HttpHeaders headers, HttpStatusCode status, WebRequest request) Customize the handling ofTypeMismatchException
. -
Uses of ResponseEntity in org.springframework.web.socket.sockjs.client
Modifier and TypeMethodDescriptionprotected abstract ResponseEntity<String>
AbstractXhrTransport.executeInfoRequestInternal
(URI infoUrl, HttpHeaders headers) protected ResponseEntity<String>
JettyXhrTransport.executeInfoRequestInternal
(URI infoUrl, HttpHeaders headers) protected ResponseEntity<String>
RestTemplateXhrTransport.executeInfoRequestInternal
(URI infoUrl, HttpHeaders headers) protected ResponseEntity<String>
UndertowXhrTransport.executeInfoRequestInternal
(URI infoUrl, HttpHeaders headers) protected ResponseEntity<String>
JettyXhrTransport.executeRequest
(URI url, org.eclipse.jetty.http.HttpMethod method, HttpHeaders headers, String body) protected ResponseEntity<String>
UndertowXhrTransport.executeRequest
(URI url, io.undertow.util.HttpString method, HttpHeaders headers, String body) protected abstract ResponseEntity<String>
AbstractXhrTransport.executeSendRequestInternal
(URI url, HttpHeaders headers, TextMessage message) JettyXhrTransport.executeSendRequestInternal
(URI url, HttpHeaders headers, TextMessage message) RestTemplateXhrTransport.executeSendRequestInternal
(URI url, HttpHeaders headers, TextMessage message) protected ResponseEntity<String>
UndertowXhrTransport.executeSendRequestInternal
(URI url, HttpHeaders headers, TextMessage message)
ModelAttributeMethodProcessor
now raises theMethodArgumentNotValidException
subclass instead.