public static interface WebTestClient.RequestHeadersSpec<S extends WebTestClient.RequestHeadersSpec<S>>
Modifier and Type | Method and Description |
---|---|
S |
accept(MediaType... acceptableMediaTypes)
Set the list of acceptable media types, as
specified by the
Accept header. |
S |
acceptCharset(java.nio.charset.Charset... acceptableCharsets)
Set the list of acceptable charsets, as specified
by the
Accept-Charset header. |
S |
attribute(java.lang.String name,
java.lang.Object value)
Set the attribute with the given name to the given value.
|
S |
attributes(java.util.function.Consumer<java.util.Map<java.lang.String,java.lang.Object>> attributesConsumer)
Manipulate the request attributes with the given consumer.
|
S |
cookie(java.lang.String name,
java.lang.String value)
Add a cookie with the given name and value.
|
S |
cookies(java.util.function.Consumer<MultiValueMap<java.lang.String,java.lang.String>> cookiesConsumer)
Manipulate this request's cookies with the given consumer.
|
WebTestClient.ResponseSpec |
exchange()
Perform the exchange without a request body.
|
S |
header(java.lang.String headerName,
java.lang.String... headerValues)
Add the given, single header value under the given name.
|
S |
headers(java.util.function.Consumer<HttpHeaders> headersConsumer)
Manipulate the request's headers with the given consumer.
|
S |
ifModifiedSince(java.time.ZonedDateTime ifModifiedSince)
Set the value of the
If-Modified-Since header. |
S |
ifNoneMatch(java.lang.String... ifNoneMatches)
Set the values of the
If-None-Match header. |
S accept(MediaType... acceptableMediaTypes)
Accept
header.acceptableMediaTypes
- the acceptable media typesS acceptCharset(java.nio.charset.Charset... acceptableCharsets)
Accept-Charset
header.acceptableCharsets
- the acceptable charsetsS cookie(java.lang.String name, java.lang.String value)
name
- the cookie namevalue
- the cookie valueS cookies(java.util.function.Consumer<MultiValueMap<java.lang.String,java.lang.String>> cookiesConsumer)
MultiValueMap
methods.cookiesConsumer
- a function that consumes the cookies mapS ifModifiedSince(java.time.ZonedDateTime ifModifiedSince)
If-Modified-Since
header.
The date should be specified as the number of milliseconds since January 1, 1970 GMT.
ifModifiedSince
- the new value of the headerS ifNoneMatch(java.lang.String... ifNoneMatches)
If-None-Match
header.ifNoneMatches
- the new value of the headerS header(java.lang.String headerName, java.lang.String... headerValues)
headerName
- the header nameheaderValues
- the header value(s)S headers(java.util.function.Consumer<HttpHeaders> headersConsumer)
HttpHeaders
methods.headersConsumer
- a function that consumes the HttpHeaders
S attribute(java.lang.String name, java.lang.Object value)
name
- the name of the attribute to addvalue
- the value of the attribute to addS attributes(java.util.function.Consumer<java.util.Map<java.lang.String,java.lang.Object>> attributesConsumer)
attributesConsumer
- a function that consumes the attributesWebTestClient.ResponseSpec exchange()