接口 WebTestClient.RequestHeadersSpec<S extends WebTestClient.RequestHeadersSpec<S>>
- 类型参数:
S- a self reference to the spec type
- 所有已知子接口:
WebTestClient.RequestBodySpec,WebTestClient.RequestBodyUriSpec,WebTestClient.RequestHeadersUriSpec<S>
- 封闭接口:
- WebTestClient
public static interface WebTestClient.RequestHeadersSpec<S extends WebTestClient.RequestHeadersSpec<S>>
Specification for adding request headers and performing an exchange.
-
方法概要
修饰符和类型方法说明accept(cn.taketoday.http.MediaType... acceptableMediaTypes) Set 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.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.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.
-
方法详细资料
-
accept
Set the list of acceptable media types, as specified by theAcceptheader.- 参数:
acceptableMediaTypes- the acceptable media types- 返回:
- the same instance
-
acceptCharset
Set the list of acceptable charsets, as specified by theAccept-Charsetheader.- 参数:
acceptableCharsets- the acceptable charsets- 返回:
- the same instance
-
cookie
Add a cookie with the given name and value.- 参数:
name- the cookie namevalue- the cookie value- 返回:
- the same instance
-
cookies
Manipulate 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.- 参数:
cookiesConsumer- a function that consumes the cookies map- 返回:
- this builder
-
ifModifiedSince
Set the value of theIf-Modified-Sinceheader.The date should be specified as the number of milliseconds since January 1, 1970 GMT.
- 参数:
ifModifiedSince- the new value of the header- 返回:
- the same instance
-
ifNoneMatch
Set the values of theIf-None-Matchheader.- 参数:
ifNoneMatches- the new value of the header- 返回:
- the same instance
-
header
Add the given, single header value under the given name.- 参数:
headerName- the header nameheaderValues- the header value(s)- 返回:
- the same instance
-
headers
Manipulate 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.- 参数:
headersConsumer- a function that consumes theHttpHeaders- 返回:
- this builder
-
attribute
Set the attribute with the given name to the given value.- 参数:
name- the name of the attribute to addvalue- the value of the attribute to add- 返回:
- this builder
-
attributes
Manipulate 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.- 参数:
attributesConsumer- a function that consumes the attributes- 返回:
- this builder
-
exchange
WebTestClient.ResponseSpec exchange()Perform the exchange without a request body.- 返回:
- spec for decoding the response
-