Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

zubaer_ahammed's avatar

Content-Type header is being removed automatically (Apache server) before POST request hits my site

It works all good on my Local server. But on my Production server POST request body is empty as Content-Type header is being removed by my server somehow before it hits my site. (I have dumped headers at the top of public/index.php file but All other headers are there except 'Content-Type'. Hence, $request->all() is empty. GET request works fine on production.

*I am running on PHP 7.4, Apache and Laravel 8.

Content-Type header is stripped off

0 likes
1 reply
zubaer_ahammed's avatar

So, I have found that Content-Type header was being removed with my GET requests. But it wasn't removed with POST, PUT requests. (Though, it was okay on my local). I ended up only using query params for GET requests.

Please or to participate in this conversation.