Fix to handle mime types with dashes

The current implementation did not generate a valid method name when using a mime type of binary/octet-stream.