http://httpbin.org Good for practice

curl -s http://httpbin.org | head -n 10

Headers Only

curl -Is http://httpbin.org 
curl -Is example.com
curl -sI -G -d "name=jim" http://httpbin.org -o /dev/null

API & GITHUB

REFERENCE: https://docs.github.com/en/rest/guides/getting-started-with-the-rest-api

curl https://api.github.com/zen

Add -s (silent)

curl -s  https://api.github.com/zen

Info about user defunkt

curl -s https://api.github.com/users/defunkt

GITHUB PAT, to authenticate

export token=$(Rscript -e "cat(Sys.getenv('GITHUB_PAT'))")
curl -si -u jimrothstein:$token https://api.github.com/users/octocat

Collaborators is private.

export token=$(Rscript -e "cat(Sys.getenv('GITHUB_PAT'))")
curl -s -u jimrothstein:$token https://api.github.com/repos/jimrothstein/try_things_here/collaborators 

GITHUB PAT, walk-through

# knitr::knit_exit()
file <- "slide_curl_intro_github.Rmd"
file  <- normalizePath(file)
file
rmarkdown::render(file, output_dir="~/Downloads/print_and_delete")


jimrothstein/yt_api documentation built on Nov. 5, 2022, 8:05 p.m.