-
Notifications
You must be signed in to change notification settings - Fork 80
Closed
Labels
Description
The content type is simply overwritten when using req_body_json()
library(httr2)
request("http://httpbin.org/404") |>
req_body_json(data.frame(x = 1)) |>
req_headers(`content-type` = "blub") |>
req_dry_run()
#> POST /404 HTTP/1.1
#> Host: httpbin.org
#> User-Agent: httr2/0.2.2.9000 r-curl/4.3.3 libcurl/7.85.0
#> Accept: */*
#> Accept-Encoding: deflate, gzip
#> Content-Type: application/json
#> Content-Length: 9
#>
#> [{"x":1}]Created on 2023-01-09 with reprex v2.0.2