org.springframework:spring-web:4.2.5.RELEASE import org.springframework.web.util.UriComponentsBuilder; ... return UriComponentsBuilder.fromUriString(url).queryParam(key, value).build().toUri();