Get “Content-Type” header of request in PHP

Normal (GET) requests do not have a Content-Type header. For POST requests it would appear as $_SERVER["CONTENT_TYPE"], with a value like multipart/form-data or application/x-www-form-urlencoded.

This is mandated by the CGI/1.1 specification: http://www.ietf.org/rfc/rfc3875.

Leave a Comment