danvega / rest-client-examples

11 stars 6 forks source link

Rest Client Examples

This is a collection of examples using the new RestClient in Spring Framework 6.1 & Spring Boot 3.2.

These are the topics that I would like to cover in this series:

RestClient Instance

X Tutorial

Client Request Factories

The RestClient uses an underlying Http Client to make calls over HTTP. If you want to read more about this you can check out the Spring Documentation. The following video is a walkthrough of how to do that. The code for this is located in /src/main/resources/dev/danvega/rc/client/JdkClient.java

YouTube Tutorial

Testing with @RestClientTest

You can test your RestClient code using the @RestClientTest annotation.

YouTube Tutorial

Note

If you run into an issue writing tests with @RestClientTest and you're using the JDK Http Client you might be running into this https://github.com/spring-projects/spring-boot/issues/38832

Live Templates

X Tutorial