Closed selesnow closed 1 year ago
Hi @selesnow, have you managed to find a solution?
interested to know the solution as well - fails in this kind of case with httr
If I understand correctly what you want, you can do this with httr2 as follows:
library(httr2)
request("http://httpbin.org/post") |>
req_body_form(a = 1, a = 2, a = 3) |>
req_dry_run()
#> POST /post HTTP/1.1
#> Host: httpbin.org
#> User-Agent: httr2/0.2.3.9000 r-curl/5.1.0 libcurl/8.1.2
#> Accept: */*
#> Accept-Encoding: deflate, gzip
#> Content-Type: application/x-www-form-urlencoded
#> Content-Length: 11
#>
#> a=1&a=2&a=3
Created on 2023-10-31 with reprex v2.0.2
httr has been superseded in favour of httr2, so is no longer under active development.
Hello Hadley!
your example in Getting started with httr
How i can send next request?
When i try this i got error:
But when i try:
All works correctly.
How i can send list of values with encode = "form" ?