Skip to content

Instantly share code, notes, and snippets.

@sckott
Forked from jeroen/body.R
Last active March 1, 2016 19:25
Show Gist options
  • Save sckott/1cfa8324360c487ffc2a to your computer and use it in GitHub Desktop.
Save sckott/1cfa8324360c487ffc2a to your computer and use it in GitHub Desktop.
Post data with GET
library(curl)
h <- new_handle()
handle_setform(h, limit = "3")
handle_setopt(h, customrequest = "POST")
handle_setheaders(h,
"X-HTTP-Method-Override" = "GET"
)
req <- curl_fetch_memory("http://data.techno-science.ca/api/3/action/package_list", handle = h)
jsonlite::fromJSON(rawToChar(req$content))$result
#> [1] "artifact-data-agriculture" "artifact-data-aviation" "artifact-data-bookbinding"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment