notes/pl/java/libfws/spring/rest/rest-template.txt
Ihar Hancharenka 7049bdd129 m
2023-08-18 19:09:04 +03:00

47 строки
2.0 KiB
Plaintext

https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/test/web/client/TestRestTemplate.html
https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/http/ResponseEntity.html
import org.springframework.web.client.RestTemplate
2023
https://www.baeldung.com/spring-resttemplate-exchange-postforentity-execute
2021
https://www.baeldung.com/rest-template
! WebClient is a modern way to go, while RestTemplate - will be deprecated
2019
http://www.baeldung.com/rest-template
https://www.baeldung.com/spring-resttemplate-post-json
https://www.baeldung.com/spring-rest-template-multipart-upload
https://github.com/eugenp/tutorials/tree/master/spring-resttemplate
https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html
https://www.baeldung.com/spring-boot-testresttemplate
!!!
https://www.baeldung.com/spring-rest-template-error-handling
2012
http://www.baeldung.com/2012/04/16/how-to-use-resttemplate-with-basic-authentication-in-spring-3-1/
@LocalServerPort
https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/web/server/LocalServerPort.html
auth
https://springbootdev.com/2018/05/18/spring-boot-test-and-spring-security-perform-http-basic-authentication-with-testresttemplate/
params
https://stackoverflow.com/questions/45884871/i-am-using-testresttemplate-to-test-with-requestparam-value-how-to-execute
https://stackoverflow.com/questions/8297215/spring-resttemplate-get-with-parameters
restTemplate.getForObject("http://example.com/hotels/{hotel}/rooms/{room}", String.class, "42", "21");
encoding
https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/util/UriComponentsBuilder.html
https://docs.oracle.com/javase/8/docs/api/java/net/URLEncoder.html
URI uri = UriComponentsBuilder.fromHttpUrl(url).path("/analyze")
.queryParam("text", "<some-text-data>")
.build().encode().toUri();
encoding issues !
https://jira.spring.io/browse/SPR-14828
misc
https://stackoverflow.com/questions/42272521/how-to-configure-spring-testresttemplate