Support encoding option for _apiRequest

Allow the consumer to set the encoding. This allows retrieval of binary files such as images.