It is generally recommended to use headers for metadata and bodies for data used by business logic.
Some points to consider:
1) If data is sent via HTTP instead of HTTPS, proxies can change headers.
2) If you use the REST protocol for communication between microservices, communication can be important. Most APIs usually do not provide the ability to add / modify custom headers.
3) It is better to have the data used by routers / firewalls in the HTTP header and limit the body to application-specific information.
source share