Has anyone noticed this error message "Content-Type header is empty" when POST-ing to Magento REST API? I'm using Postman for testing and very-very surely I'm sending the Content-Type header along with my request. So something cuts it off in between. Can it be misconfigured Apache / .htaccess? Never seen that problem with nginx before.

The error is thrown by Mage_Api2_Model_Request, in the very early stage of API request.

2 Answers 2


Allright, after messing around with Apache config I found the following: I had missing "-pass-header Content-Type" from fastcgi.conf Make sure you have it on this line:

FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host -pass-header  Authorization -pass-header Content-Type
  • Not working for me. I am passing FastCGI requests to PHP-FPM. Am I missing anything?
    – Hashid
    Nov 13, 2015 at 7:11

If you use another way of proxying requests from Apache to PHP-FPM, you can add this to your Apache vhost config:

# Pass extra http headers to PHP-FPM
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
SetEnvIfNoCase ^Content-Type$ "(.+)" HTTP_CONTENT_TYPE=$1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.