This might be a question better suited for Stack Overflow or another Spring Security group.
Postman is an HTTP client and does not control the server’s response format. If you set the Accept header in Postman to application/json and you’re still getting HTML responses, you’ll need to modify your server-side code to return JSON responses when an error occurs.
There is a Spring Security feature called an AuthenticationEntryPoint that you can implement. This feature is a starting point for handling exceptions related to authentication (like an expired JWT).