# Uses of Class
org.springframework.test.web.client.response.DefaultResponseCreator

Packages that use DefaultResponseCreator
Package
Description
org.springframework.test.web.client.response
Contains built-in `ResponseCreator` implementations.

## Uses of DefaultResponseCreator in org.springframework.test.web.client.response

Methods in org.springframework.test.web.client.response that return DefaultResponseCreator
Modifier and Type
Method
Description
`DefaultResponseCreator`
DefaultResponseCreator.`body(byte[] content)`
Set the body as a byte array.
`DefaultResponseCreator`
DefaultResponseCreator.`body(String content)`
Set the body as a UTF-8 String.
`DefaultResponseCreator`
DefaultResponseCreator.`body(String content, Charset charset)`
Set the body from a string using the given character set.
`DefaultResponseCreator`
DefaultResponseCreator.`body(org.springframework.core.io.Resource resource)`
Set the body from a `Resource`.
`DefaultResponseCreator`
DefaultResponseCreator.`contentType(org.springframework.http.MediaType mediaType)`
Set the `Content-Type` header.
`DefaultResponseCreator`
DefaultResponseCreator.`cookies(org.springframework.http.ResponseCookie... cookies)`
Add one or more cookies.
`DefaultResponseCreator`
DefaultResponseCreator.`cookies(org.springframework.util.MultiValueMap<String,org.springframework.http.ResponseCookie> multiValueMap)`
Copy all cookies from the given `MultiValueMap`.
`DefaultResponseCreator`
DefaultResponseCreator.`header(String name, String... headerValues)`
Add a response header with one or more values.
`DefaultResponseCreator`
DefaultResponseCreator.`headers(org.springframework.http.HttpHeaders headers)`
Copy all given headers.
`DefaultResponseCreator`
DefaultResponseCreator.`location(URI location)`
Set the `Location` header.
`static DefaultResponseCreator`
MockRestResponseCreators.`withAccepted()`
`ResponseCreator` for a 202 response (ACCEPTED).
`static DefaultResponseCreator`
MockRestResponseCreators.`withBadGateway()`
`ResponseCreator` for a 502 response (BAD_GATEWAY).
`static DefaultResponseCreator`
MockRestResponseCreators.`withBadRequest()`
`ResponseCreator` for a 400 response (BAD_REQUEST).
`static DefaultResponseCreator`
MockRestResponseCreators.`withCreatedEntity(URI location)`
`ResponseCreator` for a 201 response (CREATED) with a 'Location' header.
`static DefaultResponseCreator`
MockRestResponseCreators.`withForbiddenRequest()`
`ResponseCreator` for a 403 response (FORBIDDEN).
`static DefaultResponseCreator`
MockRestResponseCreators.`withGatewayTimeout()`
`ResponseCreator` for a 504 response (GATEWAY_TIMEOUT).
`static DefaultResponseCreator`
MockRestResponseCreators.`withNoContent()`
`ResponseCreator` for a 204 response (NO_CONTENT).
`static DefaultResponseCreator`
MockRestResponseCreators.`withRawStatus(int status)`
Variant of `MockRestResponseCreators.withStatus(HttpStatusCode)` with an integer.
`static DefaultResponseCreator`
MockRestResponseCreators.`withRequestConflict()`
`ResponseCreator` for a 409 response (CONFLICT).
`static DefaultResponseCreator`
MockRestResponseCreators.`withResourceNotFound()`
`ResponseCreator` for a 404 response (NOT_FOUND).
`static DefaultResponseCreator`
MockRestResponseCreators.`withServerError()`
`ResponseCreator` for a 500 response (SERVER_ERROR).
`static DefaultResponseCreator`
MockRestResponseCreators.`withServiceUnavailable()`
`ResponseCreator` for a 503 response (SERVICE_UNAVAILABLE).
`static DefaultResponseCreator`
MockRestResponseCreators.`withStatus(org.springframework.http.HttpStatusCode status)`
`ResponseCreator` with a specific HTTP status.
`static DefaultResponseCreator`
MockRestResponseCreators.`withSuccess()`
`ResponseCreator` for a 200 response (OK).
`static DefaultResponseCreator`
MockRestResponseCreators.`withSuccess(byte[] body, org.springframework.http.MediaType contentType)`
`ResponseCreator` for a 200 response (OK) with byte[] body.
`static DefaultResponseCreator`
MockRestResponseCreators.`withSuccess(String body, org.springframework.http.MediaType contentType)`
`ResponseCreator` for a 200 response (OK) with String body.
`static DefaultResponseCreator`
MockRestResponseCreators.`withSuccess(org.springframework.core.io.Resource body, org.springframework.http.MediaType contentType)`
`ResponseCreator` for a 200 response (OK) content with `Resource`-based body.
`static DefaultResponseCreator`
MockRestResponseCreators.`withTooManyRequests()`
`ResponseCreator` for a 429 ratelimited response (TOO_MANY_REQUESTS).
`static DefaultResponseCreator`
MockRestResponseCreators.`withTooManyRequests(int retryAfter)`
`ResponseCreator` for a 429 rate-limited response (TOO_MANY_REQUESTS) with a `Retry-After` header in seconds.
`static DefaultResponseCreator`
MockRestResponseCreators.`withUnauthorizedRequest()`
`ResponseCreator` for a 401 response (UNAUTHORIZED).