Use HttpServletRequest or RequestContextHolder or @RequestHeader to get http request header information

Records: 392 Scenario: To obtain HTTP request header information in microservices, you can inject HttpServletRequest into the code; you can use Spring’s RequestContextHolder, and you can use the @RequestHeader annotation. Version: JDK 1.8, SpringBoot 2.6.3, springCloud 2021.0.1 1. Use HttpServletRequest to get request header information 1.1 Get the request header at the Controller layer of […]