In Windows cURL I can post a web request similar to this:
curl --dump-header cook.txt ^
--data \"RURL=http=//www.example.com/r&user=bob&password=hell
httr
automatically preserves cookies across calls to the same site, as illustrated by these two calls to http://httpbin.org
GET("http://httpbin.org/cookies/set?a=1")
# Response [http://httpbin.org/cookies]
# Status: 200
# Content-type: application/json
# {
# "cookies": {
# "a": "1"
# }
# }
GET("http://httpbin.org/cookies")
# Response [http://httpbin.org/cookies]
# Status: 200
# Content-type: application/json
# {
# "cookies": {
# "a": "1"
# }
# }
Perhaps the problem is that you're sending your data as application/x-www-form-urlencoded
, but the default in httr is multipart/form-data
, so use multipart = FALSE
in your POST
call.