Good morning everyone. I have the following code:
String url = "https://example/example/rest/verify/";
<!-- It is absolutely necessary that code starts with / -->
String code = "/gRmaik5E5rUAoJFy7iovg==";
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(url).path(code);
UriComponents components = builder.build(true);
URI uri = components.toUri();
ResponseEntity<String> response = new RestTemplate(requestFactory1).exchange(uri, HttpMethod.GET, null, String.class);
The problem is that the uri variable is assigned to the RestTemplate constructor as https://example/example/rest/verify/gRmaik5E5rUAoJFy7iovg==
, that is, it removes the initial /
from the code variable.
I would need the url to look like this: https://example/example/rest/verify//gRmaik5E5rUAoJFy7iovg==
with two //
in the variable code.
Any requests?