Skip to content

Commit

Permalink
Serialise NULL to null in json
Browse files Browse the repository at this point in the history
Fixes #5
  • Loading branch information
hadley committed May 25, 2021
1 parent f69dc97 commit 144f80d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/req-body.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ req_body_raw <- function(req, body, type = NULL) {
)
}

req_body_json <- function(req, auto_unbox = TRUE, digits = 22, ...) {
json <- jsonlite::toJSON(body, auto_unbox = TRUE, digits = 22, ...)
req_body_json <- function(req, auto_unbox = TRUE, digits = 22, null = "null", ...) {
json <- jsonlite::toJSON(body, auto_unbox = TRUE, digits = 22, null = null, ...)
req_body_raw(json, "application/json")
}

Expand Down

0 comments on commit 144f80d

Please sign in to comment.