Upgrade to Pro — share decks privately, control downloads, hide ads and more …

API Antipatterns

API Antipatterns

Everyone *knows* how to build an API. This document describes how to NOT build one.

Mike Pearce

March 26, 2012
Tweet

More Decks by Mike Pearce

Other Decks in Technology

Transcript

  1. GET

  2. GET

  3. PUT or POST? ASIDE PUT when the resource will live

    at the target URI POST when you want the server to handle the location of the resource.
  4. HTTP/1.1 200 OK Content-Type: text/plain <?xml version="1.0" encoding="UTF-8" ?> <response

    code="error"> <error>Error!</error> <text>You have errored.</text> </response> What am I supposed to do with this?
  5. HTTP/1.1 304 NOT MODIFIED HTTP/1.1 200 OK Date: Mon, 23

    May 2005 22:38:34 GMT Last-Modified: Wed, 08 Jan 2003 23:11:55 Etag: "3f80f-1b6-3e1cb03b" Connection: close Content-Type: text/html; charset=UTF-8
  6. NO

  7. NO

  8. Photo Credits Wordle.net flickr.com/photos/wouterkiel/3717057757/ - Wouter Kiel flickr.com/photos/joe_13/19946186/ - joe_13

    flickr.com/photos/23846880@N00/391925649/ - Rutger de Moddertukker flickr.com/photos/mararie/264942105/ - mararie flickr.com/photos/ndanger/7841795/ - ndanger flickr.com/photos/yourdon/2573762303/ - Ed Yourdon flickr.com/photos/thunderchild5/225675773/ - Thunderchild7 flickr.com/photos/duchamp/126115989/ - Duchamp flickr.com/photos/thefangmonster/490423135/ - The fang monster flickr.com/photos/nostri-imago/2894328425/ - cliff1066 flickr.com/photos/epsos/4582789354/ - epSos.de flickr.com/photos/projector/2092517108/ - allie pasquier flickr.com/photos/nickstone333/3135320160/ - nickstone333 flickr.com/photos/rdrcollection/116454033/ - Rodney Ramsey flickr.com/photos/christophercarfi/2730304130/ - Christophercarfi flickr.com/photos/turatti/4526352835/ - jaci xIII