Skip to content

danvega/rest-client-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 (org.springframework.web.client) ✅
    • static factory methods
    • DefaultRestClientBuilder
  • CRUD
    • List
    • Read
    • Persist
    • Query Params
  • Testing with @RestClientTest
  • HTTP Interfaces
  • Switching Http Client Libraries ✅
  • Multipart Data
  • Jackson JSON Views
  • Error Handling
  • Interceptors
  • Retry (Interceptor)
  • Proxy (SimpleClientHttpRequestFactory)
  • Spring Cloud MVC
  • Resilience
  • Live Template ✅

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 spring-projects/spring-boot#38832

Live Templates

X Tutorial

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages