Package | Description |
---|---|
org.springframework.http |
Contains a basic abstraction over client/server-side HTTP.
|
org.springframework.http.client |
Contains an abstraction over client-side HTTP.
|
org.springframework.http.client.reactive |
Abstractions for reactive HTTP client support including
ClientHttpRequest and
ClientHttpResponse as well as a
ClientHttpConnector . |
org.springframework.http.server |
Contains an abstraction over server-side HTTP.
|
org.springframework.http.server.reactive |
Abstractions for reactive HTTP server support including a
ServerHttpRequest and
ServerHttpResponse along with an
HttpHandler for processing. |
org.springframework.mock.http.client |
Mock implementations of client-side HTTP abstractions.
|
org.springframework.mock.http.client.reactive |
Mock implementations of reactive HTTP client contracts.
|
org.springframework.test.web.client.response |
Contains built-in
ResponseCreator
implementations. |
org.springframework.test.web.reactive.server |
Support for testing Spring WebFlux server endpoints via
WebTestClient . |
org.springframework.web.client |
Core package of the client-side web support.
|
org.springframework.web.filter |
Provides generic filter base classes allowing for bean-style configuration.
|
org.springframework.web.method |
Common infrastructure for handler method processing, as used by
Spring MVC's
org.springframework.web.servlet.mvc.method package. |
org.springframework.web.method.support |
Generic support classes for handler method processing.
|
org.springframework.web.reactive.function.client |
Provides a reactive
WebClient
that builds on top of the
org.springframework.http.client.reactive reactive HTTP adapter layer. |
org.springframework.web.reactive.function.client.support |
Classes supporting the
org.springframework.web.reactive.function.client package. |
org.springframework.web.reactive.function.server |
Provides the types that make up Spring's functional web framework.
|
org.springframework.web.reactive.handler |
Provides HandlerMapping implementations including abstract base classes.
|
org.springframework.web.reactive.result.view |
Support for result handling through view resolution.
|
org.springframework.web.server |
Core interfaces and classes for Spring's generic, reactive web support.
|
org.springframework.web.server.handler |
Provides common WebHandler implementations and a
WebHandlerDecorator . |
org.springframework.web.servlet |
Provides servlets that integrate with the application context
infrastructure, and the core interfaces and classes for the
Spring web MVC framework.
|
org.springframework.web.servlet.config.annotation |
Annotation-based setup for Spring MVC.
|
org.springframework.web.servlet.mvc |
Standard controller implementations for the Servlet MVC framework that comes with
Spring.
|
org.springframework.web.servlet.mvc.method.annotation |
MVC infrastructure for annotation-based handler method processing, building on the
org.springframework.web.method.annotation package. |
org.springframework.web.servlet.view |
Provides standard View and ViewResolver implementations,
including abstract base classes for custom implementations.
|
org.springframework.web.socket.sockjs.transport.handler |
TransportHandler
implementation classes as well as a concrete
SockJsService . |
Modifier and Type | Method and Description |
---|---|
HttpStatus |
ResponseEntity.getStatusCode()
Return the HTTP status code of the response.
|
static HttpStatus |
HttpStatus.resolve(int statusCode)
Resolve the given status code to an
HttpStatus , if possible. |
static HttpStatus |
HttpStatus.valueOf(int statusCode)
Return the enum constant of this type with the specified numeric value.
|
static HttpStatus |
HttpStatus.valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static HttpStatus[] |
HttpStatus.values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
Modifier and Type | Method and Description |
---|---|
static ResponseEntity.BodyBuilder |
ResponseEntity.status(HttpStatus status)
Create a builder with the given status.
|
static HttpStatus.Series |
HttpStatus.Series.valueOf(HttpStatus status) |
Constructor and Description |
---|
ResponseEntity(HttpStatus status)
Create a new
ResponseEntity with the given status code, and no body nor headers. |
ResponseEntity(MultiValueMap<java.lang.String,java.lang.String> headers,
HttpStatus status)
Create a new
HttpEntity with the given headers and status code, and no body. |
ResponseEntity(T body,
HttpStatus status)
Create a new
ResponseEntity with the given body and status code, and no headers. |
ResponseEntity(T body,
MultiValueMap<java.lang.String,java.lang.String> headers,
HttpStatus status)
Create a new
HttpEntity with the given body, headers, and status code. |
Modifier and Type | Method and Description |
---|---|
HttpStatus |
ClientHttpResponse.getStatusCode()
Return the HTTP status code of the response.
|
HttpStatus |
AbstractClientHttpResponse.getStatusCode() |
Modifier and Type | Method and Description |
---|---|
HttpStatus |
ClientHttpResponseDecorator.getStatusCode() |
HttpStatus |
ClientHttpResponse.getStatusCode()
Return the HTTP status code of the response.
|
Modifier and Type | Method and Description |
---|---|
void |
ServletServerHttpResponse.setStatusCode(HttpStatus status) |
void |
ServerHttpResponse.setStatusCode(HttpStatus status)
Set the HTTP status code of the response.
|
Modifier and Type | Method and Description |
---|---|
HttpStatus |
ServerHttpResponse.getStatusCode()
Return the HTTP status code or
null if not set. |
HttpStatus |
ServerHttpResponseDecorator.getStatusCode() |
HttpStatus |
AbstractServerHttpResponse.getStatusCode() |
Modifier and Type | Method and Description |
---|---|
boolean |
ServerHttpResponse.setStatusCode(HttpStatus status)
Set the HTTP status code of the response.
|
boolean |
ServerHttpResponseDecorator.setStatusCode(HttpStatus status) |
boolean |
AbstractServerHttpResponse.setStatusCode(HttpStatus status) |
Modifier and Type | Method and Description |
---|---|
HttpStatus |
MockClientHttpResponse.getStatusCode() |
Constructor and Description |
---|
MockClientHttpResponse(byte[] body,
HttpStatus statusCode)
Constructor with response body as a byte array.
|
MockClientHttpResponse(java.io.InputStream body,
HttpStatus statusCode)
Constructor with response body as InputStream.
|
Modifier and Type | Method and Description |
---|---|
HttpStatus |
MockClientHttpResponse.getStatusCode() |
Constructor and Description |
---|
MockClientHttpResponse(HttpStatus status) |
Modifier and Type | Method and Description |
---|---|
static DefaultResponseCreator |
MockRestResponseCreators.withStatus(HttpStatus status)
ResponseCreator with a specific HTTP status. |
Constructor and Description |
---|
DefaultResponseCreator(HttpStatus statusCode)
Protected constructor.
|
Modifier and Type | Method and Description |
---|---|
HttpStatus |
ExchangeResult.getStatus()
Return the status of the executed request.
|
Modifier and Type | Method and Description |
---|---|
WebTestClient.ResponseSpec |
StatusAssertions.isEqualTo(HttpStatus status)
Assert the response status as an
HttpStatus . |
Modifier and Type | Method and Description |
---|---|
protected HttpStatus |
DefaultResponseErrorHandler.getHttpStatusCode(ClientHttpResponse response)
Deprecated.
as of 5.0, in favor of
DefaultResponseErrorHandler.handleError(ClientHttpResponse, HttpStatus) |
HttpStatus |
HttpStatusCodeException.getStatusCode()
Return the HTTP status code.
|
Modifier and Type | Method and Description |
---|---|
static HttpClientErrorException |
HttpClientErrorException.create(HttpStatus statusCode,
java.lang.String statusText,
HttpHeaders headers,
byte[] body,
java.nio.charset.Charset charset)
Create
HttpClientErrorException or an HTTP status specific sub-class. |
static HttpServerErrorException |
HttpServerErrorException.create(HttpStatus statusCode,
java.lang.String statusText,
HttpHeaders headers,
byte[] body,
java.nio.charset.Charset charset)
Create an
HttpServerErrorException or an HTTP status specific sub-class. |
void |
ExtractingResponseErrorHandler.handleError(ClientHttpResponse response,
HttpStatus statusCode) |
protected void |
DefaultResponseErrorHandler.handleError(ClientHttpResponse response,
HttpStatus statusCode)
Handle the error in the given response with the given resolved status code.
|
protected boolean |
ExtractingResponseErrorHandler.hasError(HttpStatus statusCode) |
protected boolean |
DefaultResponseErrorHandler.hasError(HttpStatus statusCode)
Template method called from
DefaultResponseErrorHandler.hasError(ClientHttpResponse) . |
Modifier and Type | Method and Description |
---|---|
void |
ExtractingResponseErrorHandler.setStatusMapping(java.util.Map<HttpStatus,java.lang.Class<? extends RestClientException>> statusMapping)
Set the mapping from HTTP status code to
RestClientException subclass. |
Constructor and Description |
---|
HttpClientErrorException(HttpStatus statusCode)
Constructor with a status code only.
|
HttpClientErrorException(HttpStatus statusCode,
java.lang.String statusText)
Constructor with a status code and status text.
|
HttpClientErrorException(HttpStatus statusCode,
java.lang.String statusText,
byte[] body,
java.nio.charset.Charset responseCharset)
Constructor with a status code and status text, and content.
|
HttpClientErrorException(HttpStatus statusCode,
java.lang.String statusText,
HttpHeaders headers,
byte[] body,
java.nio.charset.Charset responseCharset)
Constructor with a status code and status text, headers, and content.
|
HttpServerErrorException(HttpStatus statusCode)
Constructor with a status code only.
|
HttpServerErrorException(HttpStatus statusCode,
java.lang.String statusText)
Constructor with a status code and status text.
|
HttpServerErrorException(HttpStatus statusCode,
java.lang.String statusText,
byte[] body,
java.nio.charset.Charset charset)
Constructor with a status code and status text, and content.
|
HttpServerErrorException(HttpStatus statusCode,
java.lang.String statusText,
HttpHeaders headers,
byte[] body,
java.nio.charset.Charset charset)
Constructor with a status code and status text, headers, and content.
|
HttpStatusCodeException(HttpStatus statusCode)
Construct a new instance with an
HttpStatus . |
HttpStatusCodeException(HttpStatus statusCode,
java.lang.String statusText)
Construct a new instance with an
HttpStatus and status text. |
HttpStatusCodeException(HttpStatus statusCode,
java.lang.String statusText,
byte[] responseBody,
java.nio.charset.Charset responseCharset)
Construct instance with an
HttpStatus , status text, and content. |
HttpStatusCodeException(HttpStatus statusCode,
java.lang.String statusText,
HttpHeaders responseHeaders,
byte[] responseBody,
java.nio.charset.Charset responseCharset)
Construct instance with an
HttpStatus , status text, content, and
a response charset. |
Modifier and Type | Method and Description |
---|---|
HttpStatus |
RelativeRedirectFilter.getRedirectStatus()
Return the configured redirect status.
|
Modifier and Type | Method and Description |
---|---|
void |
RelativeRedirectFilter.setRedirectStatus(HttpStatus status)
Set the default HTTP Status to use for redirects.
|
Modifier and Type | Method and Description |
---|---|
protected HttpStatus |
HandlerMethod.getResponseStatus()
Return the specified response status, if any.
|
Modifier and Type | Method and Description |
---|---|
HttpStatus |
ModelAndViewContainer.getStatus()
Return the configured HTTP status, if any.
|
Modifier and Type | Method and Description |
---|---|
void |
ModelAndViewContainer.setStatus(HttpStatus status)
Provide an HTTP status that will be passed on to with the
ModelAndView used for view rendering purposes. |
Modifier and Type | Method and Description |
---|---|
HttpStatus |
WebClientResponseException.getStatusCode()
Return the HTTP status code value.
|
HttpStatus |
ClientResponse.statusCode()
Return the status code of this response.
|
Modifier and Type | Method and Description |
---|---|
static 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,
ExchangeStrategies strategies)
Create a response builder with the given status code and strategies for reading the body.
|
static ClientResponse.Builder |
ClientResponse.create(HttpStatus statusCode,
java.util.List<HttpMessageReader<?>> messageReaders)
Create a response builder with the given status code and message body readers.
|
ClientResponse.Builder |
ClientResponse.Builder.statusCode(HttpStatus statusCode)
Set the status code of the response.
|
Modifier and Type | Method and Description |
---|---|
WebClient.ResponseSpec |
WebClient.ResponseSpec.onStatus(java.util.function.Predicate<HttpStatus> statusPredicate,
java.util.function.Function<ClientResponse,reactor.core.publisher.Mono<? extends java.lang.Throwable>> exceptionFunction)
Register a custom error function that gets invoked when the given
HttpStatus
predicate applies. |
static ExchangeFilterFunction |
ExchangeFilterFunctions.statusError(java.util.function.Predicate<HttpStatus> statusPredicate,
java.util.function.Function<ClientResponse,? extends java.lang.Throwable> exceptionFunction)
Return a filter that generates an error signal when the given
HttpStatus predicate matches. |
Modifier and Type | Method and Description |
---|---|
HttpStatus |
ClientResponseWrapper.statusCode() |
Modifier and Type | Method and Description |
---|---|
HttpStatus |
ServerResponse.statusCode()
Return the status code of this response.
|
Modifier and Type | Method and Description |
---|---|
RenderingResponse.Builder |
RenderingResponse.Builder.status(HttpStatus status)
Set the HTTP status.
|
EntityResponse.Builder<T> |
EntityResponse.Builder.status(HttpStatus status)
Set the HTTP status.
|
static ServerResponse.BodyBuilder |
ServerResponse.status(HttpStatus status)
Create a builder with the given HTTP status.
|
Modifier and Type | Method and Description |
---|---|
protected HttpStatus |
WebFluxResponseStatusExceptionHandler.determineStatus(java.lang.Throwable ex) |
Modifier and Type | Method and Description |
---|---|
HttpStatus |
RedirectView.getStatusCode()
Get the redirect status code to use.
|
HttpStatus |
Rendering.status()
Return the HTTP status to set the response to.
|
Modifier and Type | Method and Description |
---|---|
void |
RedirectView.setStatusCode(HttpStatus statusCode)
Set an alternate redirect status code such as
TEMPORARY_REDIRECT or
PERMANENT_REDIRECT . |
B |
Rendering.Builder.status(HttpStatus status)
Specify the status to use for the response.
|
Constructor and Description |
---|
RedirectView(java.lang.String redirectUrl,
HttpStatus statusCode)
Create a new
RedirectView with the given URL and an alternate
redirect status code such as TEMPORARY_REDIRECT or
PERMANENT_REDIRECT . |
Modifier and Type | Method and Description |
---|---|
HttpStatus |
ResponseStatusException.getStatus()
The HTTP status that fits the exception (never
null ). |
Constructor and Description |
---|
ResponseStatusException(HttpStatus status)
Constructor with a response status.
|
ResponseStatusException(HttpStatus status,
java.lang.String reason)
Constructor with a response status and a reason to add to the exception
message as explanation.
|
ResponseStatusException(HttpStatus status,
java.lang.String reason,
java.lang.Throwable cause)
Constructor with a response status and a reason to add to the exception
message as explanation, as well as a nested exception.
|
Modifier and Type | Method and Description |
---|---|
protected HttpStatus |
ResponseStatusExceptionHandler.determineStatus(java.lang.Throwable ex)
Determine the HTTP status implied by the given exception.
|
Modifier and Type | Method and Description |
---|---|
HttpStatus |
ModelAndView.getStatus()
Return the configured HTTP status for the response, if any.
|
Modifier and Type | Method and Description |
---|---|
void |
ModelAndView.setStatus(HttpStatus status)
Set the HTTP status to use for the response.
|
Constructor and Description |
---|
ModelAndView(java.lang.String viewName,
HttpStatus status)
Create a new ModelAndView given a view name and HTTP status.
|
ModelAndView(java.lang.String viewName,
java.util.Map<java.lang.String,?> model,
HttpStatus status)
Create a new ModelAndView given a view name, model, and HTTP status.
|
Modifier and Type | Method and Description |
---|---|
void |
ViewControllerRegistry.addStatusController(java.lang.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 |
RedirectViewControllerRegistration.setStatusCode(HttpStatus statusCode)
Set the specific redirect 3xx status code to use.
|
ViewControllerRegistration |
ViewControllerRegistration.setStatusCode(HttpStatus statusCode)
Set the status code to set on the response.
|
Modifier and Type | Method and Description |
---|---|
HttpStatus |
ParameterizableViewController.getStatusCode()
Return the configured HTTP status code or
null . |
Modifier and Type | Method and Description |
---|---|
void |
ParameterizableViewController.setStatusCode(HttpStatus statusCode)
Configure the HTTP status code that this controller should set on the
response.
|
Modifier and Type | Method and Description |
---|---|
protected ResponseEntity<java.lang.Object> |
ResponseEntityExceptionHandler.handleAsyncRequestTimeoutException(AsyncRequestTimeoutException ex,
HttpHeaders headers,
HttpStatus status,
WebRequest webRequest)
Customize the response for NoHandlerFoundException.
|
protected ResponseEntity<java.lang.Object> |
ResponseEntityExceptionHandler.handleBindException(BindException ex,
HttpHeaders headers,
HttpStatus status,
WebRequest request)
Customize the response for BindException.
|
protected ResponseEntity<java.lang.Object> |
ResponseEntityExceptionHandler.handleConversionNotSupported(ConversionNotSupportedException ex,
HttpHeaders headers,
HttpStatus status,
WebRequest request)
Customize the response for ConversionNotSupportedException.
|
protected ResponseEntity<java.lang.Object> |
ResponseEntityExceptionHandler.handleExceptionInternal(java.lang.Exception ex,
java.lang.Object body,
HttpHeaders headers,
HttpStatus status,
WebRequest request)
A single place to customize the response body of all Exception types.
|
protected ResponseEntity<java.lang.Object> |
ResponseEntityExceptionHandler.handleHttpMediaTypeNotAcceptable(HttpMediaTypeNotAcceptableException ex,
HttpHeaders headers,
HttpStatus status,
WebRequest request)
Customize the response for HttpMediaTypeNotAcceptableException.
|
protected ResponseEntity<java.lang.Object> |
ResponseEntityExceptionHandler.handleHttpMediaTypeNotSupported(HttpMediaTypeNotSupportedException ex,
HttpHeaders headers,
HttpStatus status,
WebRequest request)
Customize the response for HttpMediaTypeNotSupportedException.
|
protected ResponseEntity<java.lang.Object> |
ResponseEntityExceptionHandler.handleHttpMessageNotReadable(HttpMessageNotReadableException ex,
HttpHeaders headers,
HttpStatus status,
WebRequest request)
Customize the response for HttpMessageNotReadableException.
|
protected ResponseEntity<java.lang.Object> |
ResponseEntityExceptionHandler.handleHttpMessageNotWritable(HttpMessageNotWritableException ex,
HttpHeaders headers,
HttpStatus status,
WebRequest request)
Customize the response for HttpMessageNotWritableException.
|
protected ResponseEntity<java.lang.Object> |
ResponseEntityExceptionHandler.handleHttpRequestMethodNotSupported(HttpRequestMethodNotSupportedException ex,
HttpHeaders headers,
HttpStatus status,
WebRequest request)
Customize the response for HttpRequestMethodNotSupportedException.
|
protected ResponseEntity<java.lang.Object> |
ResponseEntityExceptionHandler.handleMethodArgumentNotValid(MethodArgumentNotValidException ex,
HttpHeaders headers,
HttpStatus status,
WebRequest request)
Customize the response for MethodArgumentNotValidException.
|
protected ResponseEntity<java.lang.Object> |
ResponseEntityExceptionHandler.handleMissingPathVariable(MissingPathVariableException ex,
HttpHeaders headers,
HttpStatus status,
WebRequest request)
Customize the response for MissingPathVariableException.
|
protected ResponseEntity<java.lang.Object> |
ResponseEntityExceptionHandler.handleMissingServletRequestParameter(MissingServletRequestParameterException ex,
HttpHeaders headers,
HttpStatus status,
WebRequest request)
Customize the response for MissingServletRequestParameterException.
|
protected ResponseEntity<java.lang.Object> |
ResponseEntityExceptionHandler.handleMissingServletRequestPart(MissingServletRequestPartException ex,
HttpHeaders headers,
HttpStatus status,
WebRequest request)
Customize the response for MissingServletRequestPartException.
|
protected ResponseEntity<java.lang.Object> |
ResponseEntityExceptionHandler.handleNoHandlerFoundException(NoHandlerFoundException ex,
HttpHeaders headers,
HttpStatus status,
WebRequest request)
Customize the response for NoHandlerFoundException.
|
protected ResponseEntity<java.lang.Object> |
ResponseEntityExceptionHandler.handleServletRequestBindingException(ServletRequestBindingException ex,
HttpHeaders headers,
HttpStatus status,
WebRequest request)
Customize the response for ServletRequestBindingException.
|
protected ResponseEntity<java.lang.Object> |
ResponseEntityExceptionHandler.handleTypeMismatch(TypeMismatchException ex,
HttpHeaders headers,
HttpStatus status,
WebRequest request)
Customize the response for TypeMismatchException.
|
Modifier and Type | Method and Description |
---|---|
protected HttpStatus |
RedirectView.getHttp11StatusCode(HttpServletRequest request,
HttpServletResponse response,
java.lang.String targetUrl)
Determines the status code to use for HTTP 1.1 compatible requests.
|
Modifier and Type | Method and Description |
---|---|
void |
RedirectView.setStatusCode(HttpStatus statusCode)
Set the status code for this view.
|
Modifier and Type | Method and Description |
---|---|
protected abstract HttpStatus |
AbstractHttpReceivingTransportHandler.getResponseStatus() |
protected HttpStatus |
XhrReceivingTransportHandler.getResponseStatus() |