public interface ClientRequest
ExchangeFunction
. Instances of this interface can be created via static
builder methods.
Note that applications are more likely to perform requests through
WebClient
rather than using this directly.
Modifier and Type | Interface and Description |
---|---|
static interface |
ClientRequest.Builder
Defines a builder for a request.
|
Modifier and Type | Method and Description |
---|---|
default Optional<Object> |
attribute(String name)
Return the request attribute value if present.
|
Map<String,Object> |
attributes()
Return the attributes of this request.
|
BodyInserter<?,? super ClientHttpRequest> |
body()
Return the body inserter of this request.
|
MultiValueMap<String,String> |
cookies()
Return the cookies of this request.
|
static ClientRequest.Builder |
create(HttpMethod method,
URI url)
Create a request builder with the given method and url.
|
static ClientRequest.Builder |
from(ClientRequest other)
Create a builder with the method, URI, headers, and cookies of the given request.
|
HttpHeaders |
headers()
Return the headers of this request.
|
HttpMethod |
method()
Return the HTTP method.
|
static ClientRequest.Builder |
method(HttpMethod method,
URI url)
Deprecated.
in favor of
create(HttpMethod, URI) |
URI |
url()
Return the request URI.
|
reactor.core.publisher.Mono<Void> |
writeTo(ClientHttpRequest request,
ExchangeStrategies strategies)
Write this request to the given
ClientHttpRequest . |
HttpMethod method()
URI url()
HttpHeaders headers()
MultiValueMap<String,String> cookies()
BodyInserter<?,? super ClientHttpRequest> body()
default Optional<Object> attribute(String name)
name
- the attribute namereactor.core.publisher.Mono<Void> writeTo(ClientHttpRequest request, ExchangeStrategies strategies)
ClientHttpRequest
.request
- the client http request to write tostrategies
- the strategies to use when writingMono<Void>
to indicate when writing is completestatic ClientRequest.Builder from(ClientRequest other)
other
- the request to copy the method, URI, headers, and cookies from@Deprecated static ClientRequest.Builder method(HttpMethod method, URI url)
create(HttpMethod, URI)
method
- the HTTP method (GET, POST, etc)url
- the url (as a URI instance)static ClientRequest.Builder create(HttpMethod method, URI url)
method
- the HTTP method (GET, POST, etc)url
- the url (as a URI instance)