Skip to content

Instantly share code, notes, and snippets.

@vpekar
Last active February 3, 2016 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vpekar/b1ff0602a6f4efe2b44a to your computer and use it in GitHub Desktop.
Save vpekar/b1ff0602a6f4efe2b44a to your computer and use it in GitHub Desktop.
library(httr)
params <- list(
text="The food was great, but the service was slow.",
terms="1",
sentiment="1",
annotate="1"
)
headers <- add_headers("<ACCESS-KEY-HEADER>"="<ACCESS-KEY>")
response <- POST(
"<ACCESS-URL>",
headers,
body=params
)
stop_for_status(response)
content(response, "parsed", "application/json")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment