Fixed invalid conversion if Content-Type header includes optional parameters like charset, and fixed invalid conversion of json

Fixed conversion of input data in case Content-Type header includes optional parameters like `charset` (e.g. `text/html; charset=UTF-8`. Also fixed invalid conversion of json.
Merge pull request #15 from GR3S/patch-1

Fixed invalid conversion of input data