Merge branch '3.1.x'
This commit is contained in:
commit
8b3070e027
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.docs.io.restclient.webclient.ssl;
|
||||
|
||||
public class Details {
|
||||
|
||||
}
|
||||
|
|
@ -19,7 +19,6 @@ package org.springframework.boot.docs.io.restclient.webclient.ssl;
|
|||
import reactor.core.publisher.Mono;
|
||||
|
||||
import org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientSsl;
|
||||
import org.springframework.boot.docs.io.restclient.webclient.Details;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.reactive.function.client.WebClient;
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,8 @@ class MyService(webClientBuilder: WebClient.Builder) {
|
|||
}
|
||||
|
||||
fun someRestCall(name: String?): Mono<Details> {
|
||||
return webClient.get().uri("/{name}/details", name).retrieve().bodyToMono(Details::class.java)
|
||||
return webClient.get().uri("/{name}/details", name)
|
||||
.retrieve().bodyToMono(Details::class.java)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.docs.io.restclient.webclient.ssl
|
||||
|
||||
class Details
|
||||
|
|
@ -17,7 +17,6 @@
|
|||
package org.springframework.boot.docs.io.restclient.webclient.ssl
|
||||
|
||||
import org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientSsl
|
||||
import org.springframework.boot.docs.io.restclient.webclient.Details
|
||||
import org.springframework.stereotype.Service
|
||||
import org.springframework.web.reactive.function.client.WebClient
|
||||
import reactor.core.publisher.Mono
|
||||
|
|
@ -28,11 +27,13 @@ class MyService(webClientBuilder: WebClient.Builder, ssl: WebClientSsl) {
|
|||
private val webClient: WebClient
|
||||
|
||||
init {
|
||||
webClient = webClientBuilder.baseUrl("https://example.org").apply(ssl.fromBundle("mybundle")).build()
|
||||
webClient = webClientBuilder.baseUrl("https://example.org")
|
||||
.apply(ssl.fromBundle("mybundle")).build()
|
||||
}
|
||||
|
||||
fun someRestCall(name: String?): Mono<Details> {
|
||||
return webClient.get().uri("/{name}/details", name).retrieve().bodyToMono(Details::class.java)
|
||||
return webClient.get().uri("/{name}/details", name)
|
||||
.retrieve().bodyToMono(Details::class.java)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue