public static interface ClientRequest.Builder
Modifier and Type | Method and Description |
---|---|
ClientRequest.Builder |
body(BodyInserter<?,? super ClientHttpRequest> inserter)
Set the body of the request to the given
BodyInserter . |
<S,P extends <any>> |
body(P publisher,
java.lang.Class<S> elementClass)
Set the body of the request to the given
Publisher and return it. |
ClientRequest |
build()
Builds the request entity with no body.
|
ClientRequest.Builder |
cookie(java.lang.String name,
java.lang.String value)
Add a cookie with the given name and value.
|
ClientRequest.Builder |
cookies(MultiValueMap<java.lang.String,java.lang.String> cookies)
Copy the given cookies into the entity's cookies map.
|
ClientRequest.Builder |
header(java.lang.String headerName,
java.lang.String... headerValues)
Add the given, single header value under the given name.
|
ClientRequest.Builder |
headers(HttpHeaders headers)
Copy the given headers into the entity's headers map.
|
ClientRequest.Builder header(java.lang.String headerName, java.lang.String... headerValues)
headerName
- the header nameheaderValues
- the header value(s)HttpHeaders.add(String, String)
ClientRequest.Builder headers(HttpHeaders headers)
headers
- the existing HttpHeaders to copy fromClientRequest.Builder cookie(java.lang.String name, java.lang.String value)
name
- the cookie namevalue
- the cookie valueClientRequest.Builder cookies(MultiValueMap<java.lang.String,java.lang.String> cookies)
cookies
- the existing cookies to copy fromClientRequest.Builder body(BodyInserter<?,? super ClientHttpRequest> inserter)
BodyInserter
.inserter
- the BodyInserter
that writes to the request<S,P extends <any>> ClientRequest.Builder body(P publisher, java.lang.Class<S> elementClass)
Publisher
and return it.S
- the type of the elements contained in the publisherP
- the type of the Publisher
publisher
- the Publisher
to write to the requestelementClass
- the class of elements contained in the publisherClientRequest build()