- Either use suitable R package or write API call yourself
- Always check whether there is an R package that you could use!
httrpackage: Tools for Working with URLs and HTTP (and write API calls)
GET(url = NULL,query=(xxx=xxx), ...): GET something from server (e.g.,
POST(): POST something to server (e.g.,
POST("http://httpbin.org/post", body = "this is a test"))
content(): Extract content from a request
content(response, type = "text"): Override server content type with
type = "text"
- Status codes: 200 (success!), 4XX (client error), 5XX (server error)