curlconverter icon indicating copy to clipboard operation
curlconverter copied to clipboard

Unexpected conversion using -d

Open johndharrison opened this issue 8 years ago • 0 comments

Using -d we expect to see a body argument in the VERB:

> "curl -X POST -d 'a=8089' http://abcdef.org"  %>% straighten  %>% make_req -> uu
curl -X POST -d 'a=8089' http://abcdef.org
> uu
[[1]]
function () 
httr::VERB(verb = "POST", url = "http://abcdef.org")
<environment: 0x5742460>

--data correctly adds the body argument:

> "curl -X POST --data 'a=8089' http://abcdef.org"  %>% straighten  %>% make_req -> uu
curl -X POST --data 'a=8089' http://abcdef.org
> uu
[[1]]
function () 
httr::VERB(verb = "POST", url = "http://abcdef.org", body = list(a = "8089"))
<environment: 0x550e248>

johndharrison avatar Oct 20 '16 23:10 johndharrison