fix issue #51 getContentType

1. adding testcases to fail getContentType, 2.fixes - fix thrown exception when content type was null, return contentType when encoding is attached