+
+ public Mono<String> put(String uri, String body) {
+ return putForEntity(uri, body) //
+ .flatMap(this::toBody);
+ }
+
+ public Mono<ResponseEntity<String>> getForEntity(String uri) {
+ logger.debug("GET uri = '{}{}''", baseUrl, uri);
+ RequestHeadersSpec<?> request = client.get().uri(uri);
+ return retrieve(request);
+ }
+
+ public Mono<String> get(String uri) {
+ return getForEntity(uri) //
+ .flatMap(this::toBody);
+ }
+
+ public Mono<ResponseEntity<String>> deleteForEntity(String uri) {
+ logger.debug("DELETE uri = '{}{}''", baseUrl, uri);
+ RequestHeadersSpec<?> request = client.delete().uri(uri);
+ return retrieve(request);
+ }
+
+ public Mono<String> delete(String uri) {
+ return deleteForEntity(uri) //
+ .flatMap(this::toBody);
+ }
+
+ private Mono<ResponseEntity<String>> retrieve(RequestHeadersSpec<?> request) {
+ return request.retrieve() //
+ .toEntity(String.class);
+ }
+
+ Mono<String> toBody(ResponseEntity<String> entity) {
+ if (entity.getBody() == null) {
+ return Mono.just("");
+ } else {
+ return Mono.just(entity.getBody());
+ }
+ }
+