Fix issue with encoding errors on request bodies.

Body is now converted to bytes using the encoding as read from the current file.