Created
July 2, 2015 19:35
-
-
Save benneely/b810df79b17d446fb3d0 to your computer and use it in GitHub Desktop.
translate cURL to httr (R package) syntax
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(httr) | |
#Usual cURL GET call | |
# curl https://api.github.com/users/defunkt | |
GET('https://api.github.com/users/defunkt') | |
#Pass custom header | |
# curl -i -H 'Authorization: token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' https://api.github.com/repos/benneely/trailR/issues?state=all | |
GET('https://api.github.com/repos/benneely/trailR/issues?state=all', add_headers('Authorization' = 'token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment