Package org.springframework.vault.client
Interface ReactiveVaultClient.RequestBodySpec
- All Superinterfaces:
ReactiveVaultClient.RequestHeadersSpec<ReactiveVaultClient.RequestBodySpec>
- All Known Subinterfaces:
ReactiveVaultClient.RequestHeadersBodyPathSpec
- Enclosing interface:
- ReactiveVaultClient
public static interface ReactiveVaultClient.RequestBodySpec
extends ReactiveVaultClient.RequestHeadersSpec<ReactiveVaultClient.RequestBodySpec>
Contract for specifying request headers and body leading up to the exchange.
-
Method Summary
Modifier and TypeMethodDescriptionVariant ofbody(Publisher, Class)that allows using any producer that can be resolved toPublisherviaReactiveAdapterRegistry.body(Object producer, ParameterizedTypeReference<?> elementTypeRef) Variant ofbody(Publisher, ParameterizedTypeReference)that allows using any producer that can be resolved toPublisherviaReactiveAdapterRegistry.body(BodyInserter<?, ? super ClientHttpRequest> inserter) Set the body of the request using the given body inserter.<T,P extends org.reactivestreams.Publisher<T>>
ReactiveVaultClient.RequestHeadersSpec<?>Shortcut forbody(BodyInserter)with a Publisher inserter.<T,P extends org.reactivestreams.Publisher<T>>
ReactiveVaultClient.RequestHeadersSpec<?>body(P publisher, ParameterizedTypeReference<T> elementTypeRef) Variant ofbody(Publisher, Class)that allows providing element type information with generics.Shortcut forbody(BodyInserter)with a value inserter.bodyValue(T body, ParameterizedTypeReference<T> bodyType) Shortcut forbody(BodyInserter)with a value inserter.Methods inherited from interface org.springframework.vault.client.ReactiveVaultClient.RequestHeadersSpec
exchangeToFlux, exchangeToMono, header, headers, headers, namespace, retrieve, token
-
Method Details
-
bodyValue
Shortcut forbody(BodyInserter)with a value inserter. For example:Person person = ... ; Mono<Void> result = client.post() .uri("/persons/{id}", id) .contentType(MediaType.APPLICATION_JSON) .bodyValue(person) .retrieve() .bodyToMono(Void.class);For multipart requests consider providing
MultiValueMapprepared withMultipartBodyBuilder.- Parameters:
body- the value to write to the request body.- Returns:
- this builder.
- Throws:
IllegalArgumentException- ifbodyis aPublisheror producer known toReactiveAdapterRegistry- See Also:
-
bodyValue
<T> ReactiveVaultClient.RequestHeadersSpec<?> bodyValue(T body, ParameterizedTypeReference<T> bodyType) Shortcut forbody(BodyInserter)with a value inserter. For example:List<Person> list = ... ; Mono<Void> result = client.post() .uri("/persons/{id}", id) .contentType(MediaType.APPLICATION_JSON) .bodyValue(list, new ParameterizedTypeReference<List<Person>>() {};) .retrieve() .bodyToMono(Void.class);For multipart requests consider providing
MultiValueMapprepared withMultipartBodyBuilder.- Type Parameters:
T- the type of the body.- Parameters:
body- the value to write to the request body.bodyType- the type of the body, used to capture the generic type.- Returns:
- this builder.
- Throws:
IllegalArgumentException- ifbodyis aPublisheror producer known toReactiveAdapterRegistry
-
body
<T,P extends org.reactivestreams.Publisher<T>> ReactiveVaultClient.RequestHeadersSpec<?> body(P publisher, Class<T> elementClass) Shortcut forbody(BodyInserter)with a Publisher inserter. For example:Mono<Person> personMono = ... ; Mono<Void> result = client.post() .uri("/persons/{id}", id) .contentType(MediaType.APPLICATION_JSON) .body(personMono, Person.class) .retrieve() .bodyToMono(Void.class);- Type Parameters:
T- the type of the elements contained in the publisher.P- the type of thePublisher.- Parameters:
publisher- thePublisherto write to the requestelementClass- the type of elements published- Returns:
- this builder.
-
body
<T,P extends org.reactivestreams.Publisher<T>> ReactiveVaultClient.RequestHeadersSpec<?> body(P publisher, ParameterizedTypeReference<T> elementTypeRef) Variant ofbody(Publisher, Class)that allows providing element type information with generics.- Type Parameters:
T- the type of the elements contained in the publisher.P- the type of thePublisher.- Parameters:
publisher- thePublisherto write to the request.elementTypeRef- the type of elements published.- Returns:
- this builder.
-
body
Variant ofbody(Publisher, Class)that allows using any producer that can be resolved toPublisherviaReactiveAdapterRegistry.- Parameters:
producer- the producer to write to the requestelementClass- the type of elements produced- Returns:
- this builder
-
body
ReactiveVaultClient.RequestHeadersSpec<?> body(Object producer, ParameterizedTypeReference<?> elementTypeRef) Variant ofbody(Publisher, ParameterizedTypeReference)that allows using any producer that can be resolved toPublisherviaReactiveAdapterRegistry.- Parameters:
producer- the producer to write to the requestelementTypeRef- the type of elements produced- Returns:
- this builder
-
body
Set the body of the request using the given body inserter. SeeBodyInsertersfor built-inBodyInserterimplementations.- Parameters:
inserter- the body inserter to use for the request body- Returns:
- this builder
- See Also:
-