Specify encoding for incoming requests

Fixes #397