Reputation: 1178
I searched for a way to remove headers in API response, but the already answered questions are talking about an specific Header and not any of them, like: Laravel remove header values from API response
In my scenario the APIs are called from a device which doesn't care about Date
, Host
, X-Powered-By
, ... and so many other headers in API resposne. in my case response size is so important, my data is 100B
but my Headers
are about 350B
!!
so my question is how to edit or remove Headers in Laravel or PHP, is there anyway to modify these Headers and just keep the really needed ones.
Upvotes: 0
Views: 2593
Reputation:
Your web server (Nginx or Apache) is probably adding a few headers as well, not sure if you can disable all of them though. You need to edit the server/site config file for your web server to accomplish this since they are added after the php script has been executed.
Upvotes: 4