Slide 1

Slide 1 text

lets talk about @astromoose

Slide 2

Slide 2 text

mmm, rest

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

sorry

Slide 5

Slide 5 text

get to the point, jon

Slide 6

Slide 6 text

representational state transfer

Slide 7

Slide 7 text

hark, an fla!

Slide 8

Slide 8 text

We all use rest every day

Slide 9

Slide 9 text

get head post put delete trace options connect patch

Slide 10

Slide 10 text

not a standard

Slide 11

Slide 11 text

not a standard corba, rpc, soap are standards.

Slide 12

Slide 12 text

not a standard corba, rpc, soap are standards. and they are also kind of craaaap

Slide 13

Slide 13 text

SOAP: COMPLEX                    12345            

Slide 14

Slide 14 text

SOAP: COMPLEX                    12345            

Slide 15

Slide 15 text

REST: SIMPLE http://www.acme.com/phonebook/UserDetails/12345

Slide 16

Slide 16 text

REST: SIMPLE http://www.acme.com/phonebook/UserDetails/12345

Slide 17

Slide 17 text

so, rest apis.

Slide 18

Slide 18 text

so, rest apis. omg ANOTHER TLA lol

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

Get! put! post! delete! st! te! Get po del

Slide 21

Slide 21 text

SEE ALL OF THEse internet WIDGETS GET  http://awesomewidgets.com/api/widgets   ! MAKE me A WIDGET, internet POST  http://awesomewidgets.com/api/widgets   Data:          name  =  smash   ! show me this supposed SINGLE WIDGET WITH ID 123 GET  http://awesomewidgets.com/api/widgets/123   ! UPDATE THAT WIDGET UPDATE IT UPDATE ITTTT PUT  http://awesomewidgets.com/api/widgets/123   Data:          name  =  kaboom          color  =  electric  puce   ! DELETE THAT STUPID WIDGET I MEAN WHAT THE HELL internet DELETE  http://awesomewidgets.com/api/widgets/123

Slide 22

Slide 22 text

jon@raven:~  (ruby-­‐2.0.0-­‐head)   [○]  %

Slide 23

Slide 23 text

jon@raven:~  (ruby-­‐2.0.0-­‐head)   [○]  % curl  -­‐i  http://coffee.is.local/rest/players

Slide 24

Slide 24 text

jon@raven:~  (ruby-­‐2.0.0-­‐head)   [○]  % curl  -­‐i  http://coffee.is.local/rest/players HTTP/1.1  200  OK   Server:  nginx/1.0.11   Date:  Thu,  21  Nov  2013  13:54:06  GMT   Content-­‐Type:  application/json   Connection:  keep-­‐alive   vary:  Accept-­‐Encoding   content-­‐length:  3312   ! [{"_id":"ce185d9a-­‐6e8f-­‐4f82-­‐af52-­‐4f104652c38d","etab":18,"ltab": 0,"name":"Silvia","total":414},{"_id":"799e8aa0-­‐ b346-­‐48ee-­‐8d7f-­‐756d68d34de2","etab":34,"ltab": 1,"name":"Javier","total":481}, {"_id":"c9909966-­‐6d79-­‐4bce-­‐9b46-­‐9a995bbf01b3","etab":4,"ltab":

Slide 25

Slide 25 text

What happens when aN API request goes wrong?

Slide 26

Slide 26 text

handily What happens when aN API request goes wrong?

Slide 27

Slide 27 text

handily http has a whole bunch of very well understood status codes What happens when aN API request goes wrong?

Slide 28

Slide 28 text

4xx error 5xx error means i messed up means you guys messed up

Slide 29

Slide 29 text

here comes a bold statement!

Slide 30

Slide 30 text

rest apis are usually great here comes a bold statement!

Slide 31

Slide 31 text

documented & idempotent When they are

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

Twitter thrives on its clients

Slide 34

Slide 34 text

Is there anything wrong with rest?

Slide 35

Slide 35 text

real time sucks.

Slide 36

Slide 36 text

real time sucks. client API anything new? nope.

Slide 37

Slide 37 text

real time sucks. client API anything new? nope. client API How about now? nope.

Slide 38

Slide 38 text

real time sucks. client API anything new? nope. client API How about now? nope. client API And now?? widgets!

Slide 39

Slide 39 text

have big files to worry about

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

The current hip answer?

Slide 42

Slide 42 text

The current hip answer? client API

Slide 43

Slide 43 text

The current hip answer? client API hey hey new widgets!

Slide 44

Slide 44 text

The current hip answer? client API woahhhh hey hey new widgets!

Slide 45

Slide 45 text

The current hip answer? client API woahhhh hey hey new widgets! resthooks

Slide 46

Slide 46 text

POST  http://awesomewidgets.com/api/widgets/hooks   Data:           myApp  =  widgetfu           Callback  =  http://widgetfu.com/api/widgets/track   hipster api

Slide 47

Slide 47 text

i guess you're thinking

Slide 48

Slide 48 text

kthanx jon i guess you're thinking

Slide 49

Slide 49 text

kthanx jon but why should we care? i guess you're thinking

Slide 50

Slide 50 text

go forth and build internet lego

Slide 51

Slide 51 text

restcookbook.com ! apiary.io ! sinatrarb.com ! dev.twitter.com ! developer.github.com ! rest.elkstein.org ! zapier.com

Slide 52

Slide 52 text

CHeerio