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 |
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)
Create a builder with the given method and url.
|
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 fromstatic ClientRequest.Builder method(HttpMethod method, java.net.URI url)
method
- the HTTP method (GET, POST, etc)url
- the URL