request - easier HTTP requests




Scott Chamberlain

@sckottie

@sckott

rOpenSci ropensci.org


LICENSE: CC-BY 4.0

APIs

Programmatic instructions for how to interact with a piece of software



Can be the interface to:

  • A software package in R/Python/etc.
  • A public web API
  • A database
  • An operating system

HTTP

HyperText Transfer Protocol



HTTP spec: https://tools.ietf.org/html/rfc7235



  • Verbs for different actions
  • Authentication
  • Status codes
  • Request and response format
  • Most REST APIs use HTTP for data transfer

HTTP Verbs

request


github -> sckott/request


cran -> request

httpie


httpie - http://httpie.org

philosophy


nutshell: simplify to common patterns


  • Returned data probably JSON
  • You likely want to GET data
  • Output data.frame's
  • NSE makes interactive use easier

live coding




recology.info/talks/request





sckott/request



Made w/: reveal.js v3.2.0


Some Styling: Bootstrap v3.3.5


Icons by: FontAwesome v4.4.0