Skip to content

Commit

Permalink
Fix #6
Browse files Browse the repository at this point in the history
  • Loading branch information
anngvu committed Jul 17, 2024
1 parent 9ad83c8 commit 3cc991c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/api_response.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ApiResponse <- R6::R6Class(
#' @param from_encoding The encoding of the raw response.
#' @param to_encoding The target encoding of the return value.
#' @export
response_as_text = function(from_encoding = NULL, to_encoding = "UTF-8") {
response_as_text = function(from_encoding = "", to_encoding = "UTF-8") {
text_response <- iconv(readBin(self$response, character()), from = from_encoding, to = to_encoding)
if (is.na(text_response)) {
warning("The response is binary and will not be converted to text.")
Expand Down

0 comments on commit 3cc991c

Please sign in to comment.