Skip to content

Commit aa6e81e

Browse files
committed
'application/problem+json' works with last_response_json()
closes #782
1 parent c7d4a86 commit aa6e81e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

R/last.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ last_response_json <- function(pretty = TRUE) {
6161
if (is.null(resp)) {
6262
cli::cli_abort("No request has been made successfully yet.")
6363
}
64-
if (!identical(resp_content_type(resp), "application/json")) {
64+
content_type <- resp_content_type(resp)
65+
if (!(identical(content_type, "application/json") ||
66+
identical(content_type, "application/problem+json"))) {
6567
cli::cli_abort("Last response doesn't have a JSON body.")
6668
}
6769
httr2_json(resp_body_string(resp), pretty = pretty)

0 commit comments

Comments
 (0)