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 | Class and Description |
|---|---|
| public static interface | ClientRequest.
Defines a builder for a request. |
| Modifier and Type | Field and Description |
|---|---|
| public static final String | LOG_ID_ATTRIBUTE
Name of |
| Modifier and Type | Method and Description |
|---|---|
| public default Optional | |
| public Map | |
| public BodyInserter | |
| public MultiValueMap | |
| public static ClientRequest. | Returns: the created builderthe HTTP method (GET, POST, etc) method, URI the url (as a URI instance) url)Create a request builder with the given HTTP method and url. |
| public static ClientRequest. | Returns: the builder instancethe request to copy from other)Create a builder initialized with the HTTP method, url, headers, cookies, attributes, and body of the given request. |
| public HttpHeaders | |
| public Consumer | |
| public String | Returns: the log message prefix or an empty String if theLOG_ID_ATTRIBUTE is not set.Return a log message prefix to use to correlate messages for this request. |
| public HttpMethod | |
| public static ClientRequest. | Returns: the created builderthe HTTP method (GET, POST, etc) method, URI the url (as a URI instance) url)
Deprecated
in favor of
create(HttpMethod, URI)
Create a builder with the given HTTP method and url. |
| public URI | |
| public Mono | Returns: Mono<Void> to indicate when writing is completethe client http request to write to request, ExchangeStrategies the strategies to use when writing strategies)Write this request to the given |
| LOG_ID_ATTRIBUTE | back to summary |
|---|---|
| public static final String LOG_ID_ATTRIBUTE Name of
| |
| attribute | back to summary |
|---|---|
| public default Optional Return the request attribute value if present. | |
| attributes | back to summary |
|---|---|
| public Map Return the attributes of this request. | |
| body | back to summary |
|---|---|
| public BodyInserter Return the body inserter of this request. | |
| cookies | back to summary |
|---|---|
| public MultiValueMap Return the cookies of this request. | |
| create | back to summary |
|---|---|
| public static ClientRequest. Create a request builder with the given HTTP method and url.
| |
| from | back to summary |
|---|---|
| public static ClientRequest. Create a builder initialized with the HTTP method, url, headers, cookies, attributes, and body of the given request.
| |
| headers | back to summary |
|---|---|
| public HttpHeaders headers() Return the headers of this request. | |
| httpRequest | back to summary |
|---|---|
| public Consumer Return consumer(s) configured to access to the
| |
| logPrefix | back to summary |
|---|---|
| public String logPrefix() Return a log message prefix to use to correlate messages for this request.
The prefix is based on the value of the attribute
| |
| method | back to summary |
|---|---|
| public HttpMethod method() Return the HTTP method. | |
| method | back to summary |
|---|---|
| public static ClientRequest. Deprecated in favor of Create a builder with the given HTTP method and url.
| |
| url | back to summary |
|---|---|
| public URI url() Return the request URI. | |
| writeTo | back to summary |
|---|---|
| public Mono Write this request to the given
| |
| Modifier and Type | Method and Description |
|---|---|
| public ClientRequest. | |
| public ClientRequest. | Returns: this buildera function that consumes the attributes attributesConsumer)Manipulate the request attributes with the given consumer. |
| public ClientRequest. | Returns: this builderthe inserter)BodyInserter that writes to the requestSet the body of the request to the given |
| public < the type of the elements contained in the publisher S, the type of the P extends PublisherPublisher | |
| public < the type of the elements contained in the publisher S, the type of the P extends PublisherPublisher | Returns: the built requestthe publisher, ParameterizedTypeReference<S> Publisher to write to the requesta type reference describing the elements contained in the publisher typeReference)Set the body of the request to the given |
| public ClientRequest | |
| public ClientRequest. | |
| public ClientRequest. | Returns: this buildera function that consumes the cookies map cookiesConsumer)Manipulate this request's cookies with the given consumer. |
| public ClientRequest. | |
| public ClientRequest. | Returns: this buildera function that consumes the headersConsumer)HttpHeadersManipulate this request's headers with the given consumer. |
| public ClientRequest. | Returns: this buildera consumer to access the
requestConsumer)ClientHttpRequest withCallback for access to the |
| public ClientRequest. | |
| public ClientRequest. |
| attribute | back to summary |
|---|---|
| public ClientRequest. Set the attribute with the given name to the given value.
| |
| attributes | back to summary |
|---|---|
| public ClientRequest. 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. | |
| body | back to summary |
|---|---|
| public ClientRequest. Set the body of the request to the given
| |
| body | back to summary |
|---|---|
| public <S, P extends Publisher Set the body of the request to the given
| |
| body | back to summary |
|---|---|
| public <S, P extends Publisher Set the body of the request to the given
| |
| build | back to summary |
|---|---|
| public ClientRequest build() Build the request. | |
| cookie | back to summary |
|---|---|
| public ClientRequest. Add a cookie with the given name and value(s).
| |
| cookies | back to summary |
|---|---|
| public ClientRequest. 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 cookie values,
remove cookies, or use any of the other
| |
| header | back to summary |
|---|---|
| public ClientRequest. Add the given header value(s) under the given name.
| |
| headers | back to summary |
|---|---|
| public ClientRequest. Manipulate this 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 other
| |
| httpRequest | back to summary |
|---|---|
| public ClientRequest. Callback for access to the
| |
| method | back to summary |
|---|---|
| public ClientRequest. Set the method of the request.
| |
| url | back to summary |
|---|---|
| public ClientRequest. Set the url of the request.
| |