Support overriding content type via explicit header.

Closes #1027.