Uses of Enum Class
org.springframework.http.HttpStatus
Package
Description
Contains a basic abstraction over client/server-side HTTP.
Contains an abstraction over client-side HTTP.
Abstractions for reactive HTTP client support including
ClientHttpRequest
and
ClientHttpResponse
as well as a
ClientHttpConnector
.Contains an abstraction over server-side HTTP.
Abstractions for reactive HTTP server support including a
ServerHttpRequest
and
ServerHttpResponse
along with an
HttpHandler
for processing.Mock implementations of client-side HTTP abstractions.
Mock implementations of reactive HTTP client contracts.
Contains built-in
ResponseCreator
implementations.Support for testing Spring WebFlux server endpoints via
WebTestClient
.Common, generic interfaces that define minimal boundary points
between Spring's web infrastructure and other framework modules.
Core package of the client-side web support.
Provides generic filter base classes allowing for bean-style configuration.
Common infrastructure for handler method processing, as used by
Spring MVC's
org.springframework.web.servlet.mvc.method
package.Generic support classes for handler method processing.
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.Provides the types that make up Spring's functional web framework for Reactive environments.
Support for result handling through view resolution.
Core interfaces and classes for Spring's generic, reactive web support.
Provides common WebHandler implementations and a
WebHandlerDecorator
.Provides servlets that integrate with the application context
infrastructure, and the core interfaces and classes for the
Spring web MVC framework.
Annotation-based setup for Spring MVC.
Provides the types that make up Spring's functional web framework for Servlet environments.
Standard controller implementations for the Servlet MVC framework that comes with
Spring.
MVC infrastructure for annotation-based handler method processing, building on the
org.springframework.web.method.annotation
package.Provides standard View and ViewResolver implementations,
including abstract base classes for custom implementations.
TransportHandler
implementation classes as well as a concrete
SockJsService
.-
Uses of HttpStatus in org.springframework.http
Modifier and TypeMethodDescriptionResponseEntity.getStatusCode()
Return the HTTP status code of the response.static HttpStatus
HttpStatus.resolve
(int statusCode) Resolve the given status code to anHttpStatus
, if possible.static HttpStatus
HttpStatus.valueOf
(int statusCode) Return theHttpStatus
enum constant with the specified numeric value.static HttpStatus
Returns the enum constant of this class with the specified name.static HttpStatus[]
HttpStatus.values()
Returns an array containing the constants of this enum class, in the order they are declared.Modifier and TypeMethodDescriptionstatic ProblemDetail
ProblemDetail.forStatus
(HttpStatus status) Create aProblemDetail
instance with the given status code.static ResponseEntity.BodyBuilder
ResponseEntity.status
(HttpStatus status) Create a builder with the given status.static HttpStatus.Series
HttpStatus.Series.valueOf
(HttpStatus status) Deprecated.ProblemDetail.withStatus
(HttpStatus status) Variant ofProblemDetail.setStatus(int)
for chained initialization.ModifierConstructorDescriptionResponseEntity
(HttpStatus status) Create aResponseEntity
with a status code only.ResponseEntity
(MultiValueMap<String, String> headers, HttpStatus status) Create aResponseEntity
with headers and a status code.ResponseEntity
(T body, HttpStatus status) Create aResponseEntity
with a body and status code.ResponseEntity
(T body, MultiValueMap<String, String> headers, HttpStatus status) Create aResponseEntity
with a body, headers, and a status code. -
Uses of HttpStatus in org.springframework.http.client
Modifier and TypeMethodDescriptionAbstractClientHttpResponse.getStatusCode()
ClientHttpResponse.getStatusCode()
Get the HTTP status code as anHttpStatus
enum value. -
Uses of HttpStatus in org.springframework.http.client.reactive
Modifier and TypeMethodDescriptionClientHttpResponse.getStatusCode()
Return the HTTP status code as anHttpStatus
enum value.ClientHttpResponseDecorator.getStatusCode()
-
Uses of HttpStatus in org.springframework.http.server
Modifier and TypeMethodDescriptionvoid
DelegatingServerHttpResponse.setStatusCode
(HttpStatus status) void
ServerHttpResponse.setStatusCode
(HttpStatus status) Set the HTTP status code of the response.void
ServletServerHttpResponse.setStatusCode
(HttpStatus status) -
Uses of HttpStatus in org.springframework.http.server.reactive
Modifier and TypeMethodDescriptionAbstractServerHttpResponse.getStatusCode()
ServerHttpResponse.getStatusCode()
Return the status code that has been set, or otherwise fall back on the status of the response from the underlying server.ServerHttpResponseDecorator.getStatusCode()
Modifier and TypeMethodDescriptionboolean
AbstractServerHttpResponse.setStatusCode
(HttpStatus status) boolean
ServerHttpResponse.setStatusCode
(HttpStatus status) Set the HTTP status code of the response.boolean
ServerHttpResponseDecorator.setStatusCode
(HttpStatus status) -
Uses of HttpStatus in org.springframework.mock.http.client
ModifierConstructorDescriptionMockClientHttpResponse
(byte[] body, HttpStatus statusCode) Constructor with response body as a byte array.MockClientHttpResponse
(InputStream body, HttpStatus statusCode) Constructor with response body as InputStream. -
Uses of HttpStatus in org.springframework.mock.http.client.reactive
-
Uses of HttpStatus in org.springframework.test.web.client.response
Modifier and TypeMethodDescriptionstatic DefaultResponseCreator
MockRestResponseCreators.withStatus
(HttpStatus status) ResponseCreator
with a specific HTTP status.ModifierConstructorDescriptionprotected
DefaultResponseCreator
(HttpStatus statusCode) Protected constructor. -
Uses of HttpStatus in org.springframework.test.web.reactive.server
Modifier and TypeMethodDescriptionExchangeResult.getStatus()
Return the HTTP status code as anHttpStatus
enum value.Modifier and TypeMethodDescriptionStatusAssertions.isEqualTo
(HttpStatus status) Assert the response status as anHttpStatus
. -
Uses of HttpStatus in org.springframework.web
Modifier and TypeMethodDescriptiondefault HttpStatus
ErrorResponse.getStatus()
Return the HTTP status to use for the response.ModifierConstructorDescriptionErrorResponseException
(HttpStatus status) Constructor with a well-knownHttpStatus
.ErrorResponseException
(HttpStatus status, Throwable cause) Constructor with a well-knownHttpStatus
and an optional cause. -
Uses of HttpStatus in org.springframework.web.client
Modifier and TypeMethodDescriptionHttpStatusCodeException.getStatusCode()
Return the HTTP status code.Modifier and TypeMethodDescriptionstatic HttpClientErrorException
HttpClientErrorException.create
(String message, HttpStatus statusCode, String statusText, HttpHeaders headers, byte[] body, Charset charset) Variant ofHttpClientErrorException.create(HttpStatus, String, HttpHeaders, byte[], Charset)
with an optional prepared message.static HttpClientErrorException
HttpClientErrorException.create
(HttpStatus statusCode, String statusText, HttpHeaders headers, byte[] body, Charset charset) CreateHttpClientErrorException
or an HTTP status specific sub-class.static HttpServerErrorException
HttpServerErrorException.create
(String message, HttpStatus statusCode, String statusText, HttpHeaders headers, byte[] body, Charset charset) Variant ofHttpServerErrorException.create(String, HttpStatus, String, HttpHeaders, byte[], Charset)
with an optional prepared message.static HttpServerErrorException
HttpServerErrorException.create
(HttpStatus statusCode, String statusText, HttpHeaders headers, byte[] body, Charset charset) Create anHttpServerErrorException
or an HTTP status specific sub-class.protected void
DefaultResponseErrorHandler.handleError
(ClientHttpResponse response, HttpStatus statusCode) Handle the error based on the resolved status code.void
ExtractingResponseErrorHandler.handleError
(ClientHttpResponse response, HttpStatus statusCode) protected boolean
DefaultResponseErrorHandler.hasError
(HttpStatus statusCode) Template method called fromDefaultResponseErrorHandler.hasError(ClientHttpResponse)
.protected boolean
ExtractingResponseErrorHandler.hasError
(HttpStatus statusCode) Modifier and TypeMethodDescriptionvoid
ExtractingResponseErrorHandler.setStatusMapping
(Map<HttpStatus, Class<? extends RestClientException>> statusMapping) Set the mapping from HTTP status code toRestClientException
subclass.ModifierConstructorDescriptionHttpClientErrorException
(String message, HttpStatus statusCode, String statusText, HttpHeaders headers, byte[] body, Charset responseCharset) Constructor with a status code and status text, headers, and content, and an prepared message.HttpClientErrorException
(HttpStatus statusCode) Constructor with a status code only.HttpClientErrorException
(HttpStatus statusCode, String statusText) Constructor with a status code and status text.HttpClientErrorException
(HttpStatus statusCode, String statusText, byte[] body, Charset responseCharset) Constructor with a status code and status text, and content.HttpClientErrorException
(HttpStatus statusCode, String statusText, HttpHeaders headers, byte[] body, Charset responseCharset) Constructor with a status code and status text, headers, and content.HttpServerErrorException
(String message, HttpStatus statusCode, String statusText, HttpHeaders headers, byte[] body, Charset charset) Constructor with a status code and status text, headers, content, and an prepared message.HttpServerErrorException
(HttpStatus statusCode) Constructor with a status code only.HttpServerErrorException
(HttpStatus statusCode, String statusText) Constructor with a status code and status text.HttpServerErrorException
(HttpStatus statusCode, String statusText, byte[] body, Charset charset) Constructor with a status code and status text, and content.HttpServerErrorException
(HttpStatus statusCode, String statusText, HttpHeaders headers, byte[] body, Charset charset) Constructor with a status code and status text, headers, and content.protected
HttpStatusCodeException
(String message, HttpStatus statusCode, String statusText, HttpHeaders responseHeaders, byte[] responseBody, Charset responseCharset) Construct instance with anHttpStatus
, status text, content, and a response charset.protected
HttpStatusCodeException
(HttpStatus statusCode) Construct a new instance with anHttpStatus
.protected
HttpStatusCodeException
(HttpStatus statusCode, String statusText) Construct a new instance with anHttpStatus
and status text.protected
HttpStatusCodeException
(HttpStatus statusCode, String statusText, byte[] responseBody, Charset responseCharset) Construct instance with anHttpStatus
, status text, and content.protected
HttpStatusCodeException
(HttpStatus statusCode, String statusText, HttpHeaders responseHeaders, byte[] responseBody, Charset responseCharset) Construct instance with anHttpStatus
, status text, content, and a response charset. -
Uses of HttpStatus in org.springframework.web.filter
Modifier and TypeMethodDescriptionRelativeRedirectFilter.getRedirectStatus()
Return the configured redirect status.Modifier and TypeMethodDescriptionvoid
RelativeRedirectFilter.setRedirectStatus
(HttpStatus status) Set the default HTTP Status to use for redirects. -
Uses of HttpStatus in org.springframework.web.method
Modifier and TypeMethodDescriptionprotected HttpStatus
HandlerMethod.getResponseStatus()
Return the specified response status, if any. -
Uses of HttpStatus in org.springframework.web.method.support
Modifier and TypeMethodDescriptionModelAndViewContainer.getStatus()
Return the configured HTTP status, if any.Modifier and TypeMethodDescriptionvoid
ModelAndViewContainer.setStatus
(HttpStatus status) Provide an HTTP status that will be passed on to with theModelAndView
used for view rendering purposes. -
Uses of HttpStatus in org.springframework.web.reactive.function.client
Modifier and TypeMethodDescriptionWebClientResponseException.getStatusCode()
Return the HTTP status code value.ClientResponse.statusCode()
Return the HTTP status code as anHttpStatus
enum value.Modifier and TypeMethodDescriptionstatic ClientResponse.Builder
ClientResponse.create
(HttpStatus statusCode) Create a response builder with the given status code and using default strategies for reading the body.static ClientResponse.Builder
ClientResponse.create
(HttpStatus statusCode, List<HttpMessageReader<?>> messageReaders) Create a response builder with the given status code and message body readers.static ClientResponse.Builder
ClientResponse.create
(HttpStatus statusCode, ExchangeStrategies strategies) Create a response builder with the given status code and strategies for reading the body.ClientResponse.Builder.statusCode
(HttpStatus statusCode) Set the status code of the response.Modifier and TypeMethodDescriptionWebClient.ResponseSpec.onStatus
(Predicate<HttpStatus> statusPredicate, Function<ClientResponse, reactor.core.publisher.Mono<? extends Throwable>> exceptionFunction) Provide a function to map specific error status codes to an error signal to be propagated downstream instead of the response.static ExchangeFilterFunction
ExchangeFilterFunctions.statusError
(Predicate<HttpStatus> statusPredicate, Function<ClientResponse, ? extends Throwable> exceptionFunction) Return a filter that generates an error signal when the givenHttpStatus
predicate matches. -
Uses of HttpStatus in org.springframework.web.reactive.function.client.support
-
Uses of HttpStatus in org.springframework.web.reactive.function.server
Modifier and TypeMethodDescriptionServerResponse.statusCode()
Return the status code of this response.Modifier and TypeMethodDescriptionEntityResponse.Builder.status
(HttpStatus status) Set the HTTP status.RenderingResponse.Builder.status
(HttpStatus status) Set the HTTP status.static ServerResponse.BodyBuilder
ServerResponse.status
(HttpStatus status) Create a builder with the given HTTP status. -
Uses of HttpStatus in org.springframework.web.reactive.result.view
Modifier and TypeMethodDescriptionRedirectView.getStatusCode()
Get the redirect status code to use.Rendering.status()
Return the HTTP status to set the response to.Modifier and TypeMethodDescriptionvoid
RedirectView.setStatusCode
(HttpStatus statusCode) Set an alternate redirect status code such asTEMPORARY_REDIRECT
orPERMANENT_REDIRECT
.Rendering.Builder.status
(HttpStatus status) Specify the status to use for the response.ModifierConstructorDescriptionRedirectView
(String redirectUrl, HttpStatus statusCode) Create a newRedirectView
with the given URL and an alternate redirect status code such asTEMPORARY_REDIRECT
orPERMANENT_REDIRECT
. -
Uses of HttpStatus in org.springframework.web.server
ModifierConstructorDescriptionResponseStatusException
(HttpStatus status) Constructor with a response status.ResponseStatusException
(HttpStatus status, String reason) Constructor with a response status and a reason to add to the exception message as explanation.ResponseStatusException
(HttpStatus status, String reason, Throwable cause) Constructor with a response status and a reason to add to the exception message as explanation, as well as a nested exception. -
Uses of HttpStatus in org.springframework.web.server.handler
Modifier and TypeMethodDescriptionprotected HttpStatus
ResponseStatusExceptionHandler.determineStatus
(Throwable ex) Deprecated.as of 5.3 in favor ofResponseStatusExceptionHandler.determineRawStatusCode(Throwable)
. -
Uses of HttpStatus in org.springframework.web.servlet
Modifier and TypeMethodDescriptionModelAndView.getStatus()
Return the configured HTTP status for the response, if any.Modifier and TypeMethodDescriptionvoid
ModelAndView.setStatus
(HttpStatus status) Set the HTTP status to use for the response.ModifierConstructorDescriptionModelAndView
(String viewName, Map<String, ?> model, HttpStatus status) Create a new ModelAndView given a view name, model, and HTTP status.ModelAndView
(String viewName, HttpStatus status) Create a new ModelAndView given a view name and HTTP status. -
Uses of HttpStatus in org.springframework.web.servlet.config.annotation
Modifier and TypeMethodDescriptionvoid
ViewControllerRegistry.addStatusController
(String urlPath, HttpStatus statusCode) Map a simple controller to the given URL path (or pattern) in order to set the response status to the given code without rendering a body.RedirectViewControllerRegistration.setStatusCode
(HttpStatus statusCode) Set the specific redirect 3xx status code to use.ViewControllerRegistration.setStatusCode
(HttpStatus statusCode) Set the status code to set on the response. -
Uses of HttpStatus in org.springframework.web.servlet.function
Modifier and TypeMethodDescriptionServerResponse.statusCode()
Return the status code of this response.Modifier and TypeMethodDescriptionEntityResponse.Builder.status
(HttpStatus status) Set the HTTP status.RenderingResponse.Builder.status
(HttpStatus status) Set the HTTP status.static ServerResponse.BodyBuilder
ServerResponse.status
(HttpStatus status) Create a builder with the given HTTP status. -
Uses of HttpStatus in org.springframework.web.servlet.mvc
Modifier and TypeMethodDescriptionParameterizableViewController.getStatusCode()
Return the configured HTTP status code ornull
.Modifier and TypeMethodDescriptionvoid
ParameterizableViewController.setStatusCode
(HttpStatus statusCode) Configure the HTTP status code that this controller should set on the response. -
Uses of HttpStatus in org.springframework.web.servlet.mvc.method.annotation
Modifier and TypeMethodDescriptionprotected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleAsyncRequestTimeoutException
(AsyncRequestTimeoutException ex, HttpHeaders headers, HttpStatus status, WebRequest webRequest) Customize the response for AsyncRequestTimeoutException.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleBindException
(BindException ex, HttpHeaders headers, HttpStatus status, WebRequest request) Customize the response for BindException.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleConversionNotSupported
(ConversionNotSupportedException ex, HttpHeaders headers, HttpStatus status, WebRequest request) Customize the response for ConversionNotSupportedException.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleExceptionInternal
(Exception ex, Object body, HttpHeaders headers, HttpStatus status, WebRequest webRequest) A single place to customize the response body of all exception types.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleHttpMediaTypeNotAcceptable
(HttpMediaTypeNotAcceptableException ex, HttpHeaders headers, HttpStatus status, WebRequest request) Customize the response for HttpMediaTypeNotAcceptableException.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleHttpMediaTypeNotSupported
(HttpMediaTypeNotSupportedException ex, HttpHeaders headers, HttpStatus status, WebRequest request) Customize the response for HttpMediaTypeNotSupportedException.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleHttpMessageNotReadable
(HttpMessageNotReadableException ex, HttpHeaders headers, HttpStatus status, WebRequest request) Customize the response for HttpMessageNotReadableException.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleHttpMessageNotWritable
(HttpMessageNotWritableException ex, HttpHeaders headers, HttpStatus status, WebRequest request) Customize the response for HttpMessageNotWritableException.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleHttpRequestMethodNotSupported
(HttpRequestMethodNotSupportedException ex, HttpHeaders headers, HttpStatus status, WebRequest request) Customize the response for HttpRequestMethodNotSupportedException.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleMethodArgumentNotValid
(MethodArgumentNotValidException ex, HttpHeaders headers, HttpStatus status, WebRequest request) Customize the response for MethodArgumentNotValidException.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleMissingPathVariable
(MissingPathVariableException ex, HttpHeaders headers, HttpStatus status, WebRequest request) Customize the response for MissingPathVariableException.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleMissingServletRequestParameter
(MissingServletRequestParameterException ex, HttpHeaders headers, HttpStatus status, WebRequest request) Customize the response for MissingServletRequestParameterException.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleMissingServletRequestPart
(MissingServletRequestPartException ex, HttpHeaders headers, HttpStatus status, WebRequest request) Customize the response for MissingServletRequestPartException.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleNoHandlerFoundException
(NoHandlerFoundException ex, HttpHeaders headers, HttpStatus status, WebRequest request) Customize the response for NoHandlerFoundException.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleServletRequestBindingException
(ServletRequestBindingException ex, HttpHeaders headers, HttpStatus status, WebRequest request) Customize the response for ServletRequestBindingException.protected ResponseEntity<Object>
ResponseEntityExceptionHandler.handleTypeMismatch
(TypeMismatchException ex, HttpHeaders headers, HttpStatus status, WebRequest request) Customize the response for TypeMismatchException. -
Uses of HttpStatus in org.springframework.web.servlet.view
Modifier and TypeMethodDescriptionprotected HttpStatus
RedirectView.getHttp11StatusCode
(HttpServletRequest request, HttpServletResponse response, String targetUrl) Determines the status code to use for HTTP 1.1 compatible requests.Modifier and TypeMethodDescriptionvoid
RedirectView.setStatusCode
(HttpStatus statusCode) Set the status code for this view. -
Uses of HttpStatus in org.springframework.web.socket.sockjs.transport.handler
Modifier and TypeMethodDescriptionprotected abstract HttpStatus
AbstractHttpReceivingTransportHandler.getResponseStatus()
protected HttpStatus
XhrReceivingTransportHandler.getResponseStatus()
series()
directly