spring-framework / org.springframework.web.reactive.function.client / ClientRequest

ClientRequest

interface ClientRequest

Represents a typed, immutable, client-side HTTP request, as executed by the 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.

Author
Brian Clozel

Author
Arjen Poutsma

Since
5.0

Functions

attribute

open fun attribute(name: String): Optional<Any>

Return the request attribute value if present.

attributes

abstract fun attributes(): MutableMap<String, Any>

Return the attributes of this request.

body

abstract fun body(): BodyInserter<*, in ClientHttpRequest>

Return the body inserter of this request.

cookies

abstract fun cookies(): MultiValueMap<String, String>

Return the cookies of this request.

from

open static fun from(other: ClientRequest): Builder

Create a builder with the method, URI, headers, and cookies of the given request.

headers

abstract fun headers(): HttpHeaders

Return the headers of this request.

method

abstract fun method(): HttpMethod

Return the HTTP method.

open static fun method(method: HttpMethod, url: URI): Builder

Create a builder with the given method and url.

url

abstract fun url(): URI

Return the request URI.

writeTo

abstract fun writeTo(request: ClientHttpRequest, strategies: ExchangeStrategies): Mono<Void>

Writes this request to the given ClientHttpRequest.