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 java.util.Optional<java.lang.Object> |
attribute(java.lang.String name)
Return the request attribute value if present.
|
java.util.Map<java.lang.String,java.lang.Object> |
attributes()
Return the attributes of this request.
|
BodyInserter<?,? super ClientHttpRequest> |
body()
Return the body inserter of this request.
|
MultiValueMap<java.lang.String,java.lang.String> |
cookies()
Return the cookies of this request.
|
static ClientRequest.Builder |
create(HttpMethod method,
java.net.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,
java.net.URI url)
Deprecated.
in favor of
create(HttpMethod, URI) |
java.net.URI |
url()
Return the request URI.
|
reactor.core.publisher.Mono<java.lang.Void> |
writeTo(ClientHttpRequest request,
ExchangeStrategies strategies)
Writes this request to the given
ClientHttpRequest. |
HttpMethod method()
java.net.URI url()
HttpHeaders headers()
MultiValueMap<java.lang.String,java.lang.String> cookies()
BodyInserter<?,? super ClientHttpRequest> body()
default java.util.Optional<java.lang.Object> attribute(java.lang.String name)
name - the attribute namejava.util.Map<java.lang.String,java.lang.Object> attributes()
reactor.core.publisher.Mono<java.lang.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, java.net.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, java.net.URI url)
method - the HTTP method (GET, POST, etc)url - the url (as a URI instance)