Interface WebTestClient.RequestHeadersSpec<S extends WebTestClient.RequestHeadersSpec<S>>
- Type Parameters:
- S- a self reference to the spec type
- All Known Subinterfaces:
- WebTestClient.RequestBodySpec,- WebTestClient.RequestBodyUriSpec,- WebTestClient.RequestHeadersUriSpec<S>
- Enclosing interface:
- WebTestClient
public static interface WebTestClient.RequestHeadersSpec<S extends WebTestClient.RequestHeadersSpec<S>>
Specification for adding request headers and performing an exchange.
- 
Method SummaryModifier and TypeMethodDescriptionSet the list of acceptable media types, as specified by theAcceptheader.acceptCharset(Charset... acceptableCharsets) Set the list of acceptable charsets, as specified by theAccept-Charsetheader.Set the attribute with the given name to the given value.attributes(Consumer<Map<String, Object>> attributesConsumer) Manipulate the request attributes with the given consumer.Add a cookie with the given name and value.cookies(Consumer<MultiValueMap<String, String>> cookiesConsumer) Manipulate this request's cookies with the given consumer.exchange()Perform the exchange without a request body.Add the given, single header value under the given name.headers(Consumer<HttpHeaders> headersConsumer) Manipulate the request's headers with the given consumer.ifModifiedSince(ZonedDateTime ifModifiedSince) Set the value of theIf-Modified-Sinceheader.ifNoneMatch(String... ifNoneMatches) Set the values of theIf-None-Matchheader.
- 
Method Details- 
acceptSet the list of acceptable media types, as specified by theAcceptheader.- Parameters:
- acceptableMediaTypes- the acceptable media types
- Returns:
- the same instance
 
- 
acceptCharsetSet the list of acceptable charsets, as specified by theAccept-Charsetheader.- Parameters:
- acceptableCharsets- the acceptable charsets
- Returns:
- the same instance
 
- 
cookieAdd a cookie with the given name and value.- Parameters:
- name- the cookie name
- value- the cookie value
- Returns:
- the same instance
 
- 
cookiesManipulate this request's cookies with the given consumer. The map provided to the consumer is "live", so that the consumer can be used to overwrite existing header values, remove values, or use any of the otherMultiValueMapmethods.- Parameters:
- cookiesConsumer- a function that consumes the cookies map
- Returns:
- this builder
 
- 
ifModifiedSinceSet the value of theIf-Modified-Sinceheader.The date should be specified as the number of milliseconds since January 1, 1970 GMT. - Parameters:
- ifModifiedSince- the new value of the header
- Returns:
- the same instance
 
- 
ifNoneMatchSet the values of theIf-None-Matchheader.- Parameters:
- ifNoneMatches- the new value of the header
- Returns:
- the same instance
 
- 
headerAdd the given, single header value under the given name.- Parameters:
- headerName- the header name
- headerValues- the header value(s)
- Returns:
- the same instance
 
- 
headersManipulate the request's headers with the given consumer. The headers provided to the consumer are "live", so that the consumer can be used to overwrite existing header values, remove values, or use any of the otherHttpHeadersmethods.- Parameters:
- headersConsumer- a function that consumes the- HttpHeaders
- Returns:
- this builder
 
- 
attributeSet the attribute with the given name to the given value.- Parameters:
- name- the name of the attribute to add
- value- the value of the attribute to add
- Returns:
- this builder
 
- 
attributesManipulate the request attributes with the given consumer. The attributes provided to the consumer are "live", so that the consumer can be used to inspect attributes, remove attributes, or use any of the other map-provided methods.- Parameters:
- attributesConsumer- a function that consumes the attributes
- Returns:
- this builder
 
- 
exchangeWebTestClient.ResponseSpec exchange()Perform the exchange without a request body.- Returns:
- spec for decoding the response
 
 
-