We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
last_response_json()
1 parent c7d4a86 commit aa6e81eCopy full SHA for aa6e81e
R/last.R
@@ -61,7 +61,9 @@ last_response_json <- function(pretty = TRUE) {
61
if (is.null(resp)) {
62
cli::cli_abort("No request has been made successfully yet.")
63
}
64
- if (!identical(resp_content_type(resp), "application/json")) {
+ content_type <- resp_content_type(resp)
65
+ if (!(identical(content_type, "application/json") ||
66
+ identical(content_type, "application/problem+json"))) {
67
cli::cli_abort("Last response doesn't have a JSON body.")
68
69
httr2_json(resp_body_string(resp), pretty = pretty)
0 commit comments