You need to add a rewrite rule in Charles to change the Content-Type header back to application/json.
Map Local will only give a text/plain Content-Type.
To do this, go to Tools > Rewrite... > Add.
Add all the locations that you are mapping locally and then for the rules, add one that looks like the following:
I would never recommend adjusting your code just for Charles as this defeats the point of testing your web services if you can't replicate them exactly.