I\'m attempting to use spring\'s UriComponentsBuilder to generate some urls for oauth interaction. The query parameters include such entities as callback urls and parameter
Try to scan the UriComponentsBuilder doc, there is method named build(boolean encoded)
Sample code 1:
UriComponents uriComponents = UriComponentsBuilder.fromPath("/path1/path2").build(true);
Here is my sample code 2:
UriComponents uriComponents = UriComponentsBuilder.newInstance()
.scheme("https")
.host("my.host")
.path("/path1/path2").query(parameters).build(true);
URI uri= uriComponents.toUri();
ResponseEntity responseEntity = restTemplate.exchange(uri,
HttpMethod.GET, entity, typeRef);