When communicating with external APIs, we often use a RestTemplate, WebClient, or RestClient. All of these can be instrumented to log the requests they are sending so we can look into them and ensure they look how we expect them to.
This tutorial shows how to write a custom interceptor to inspect HTTP requests performed with the new RestClient.
⛩️ Navigation
00:00 - Intro
00:11 - Let's Code
00:33 - Add the RestClient
00:59 - Add the logging ClientHttpRequestInterceptor
05:13 - Add the interceptor to the RestClient
🍃 Code & Resources
Grab the code for this tutorial here https://axgr.dev/posts/spring-log-out...
🙌 Get in Touch
Join my newsletter and say hi here https://axgr.dev/newsletter/?utm_camp...
🎙 Gear & Links
Mechanical Keyboard: https://x.axgr.dev/keyboard
Studio Camera: https://x.axgr.dev/studio-camera
Studio Lens: https://x.axgr.dev/studio-lens
Studio Mic: https://x.axgr.dev/studio-mic
Vlog Camera: https://x.axgr.dev/vlog-camera
Vlog Lens: https://x.axgr.dev/vlog-lens
All my affiliate links https://axgr.dev/deals/?utm_campaign=...
I may earn a small commission for purchases made through the links above at no additional cost to you.
🎶 Music
Background music by / @kainbeats
🍿 Subscribe
Want to see more tech tutorials? Subscribe now!