REST Workshop
REST API workshop ¶
We held our first internal workshop today on REST APIs.
The video and slides are below and a link to the apiary.io discussion project can be found here.
What is REST? ¶
- Roy Fielding
- HTTP
- Distributed data
- Web APIs (GitHub, Twitter etc)
tl;dr ¶
GET /users -> index
GET /users/new -> new
POST /users -> create
GET /users/:user -> show
PUT /users/:user -> update
DELETE /users/:user -> destroy
Convention Not Standard ¶
- Convention is an interpretation
- Yoda
- Missing patterns
- You will be annoyed
Why this convention? ¶
- SOAP etc
- Clients
- Standardisation
- Frameworks
- pebble case study - TaxiApp
What to think about ¶
- Data
- Documentation
- Versioning
- Authentication
- Deprecation
What’s the best way to learn? ¶
- HTTP specification
- Build a client
- Resources
- Work with clients
- Be pragmatic
REST.next or Hypermedia ¶
- HATEOAS
- Discoverability
- Smart clients
- Work in progress
REST doesn’t work for everything ¶
- Event driven-apis
- WebSockets
- Messaging
Conclusion ¶
- On the web? Use REST. Use JSON.
- Prepare for frustration
- Be a pragmatist
- Be responsible
- Love your clients
- Free your data
Tags
Can you help make this article better? You can edit it here and send me a pull request.
See Also
-
Google Plus is not the Internet
The mothballing of Google Reader is another sign that the strategy for Google+ is to become an end-to-end content platform. The is a real danger that open technologies could become Google APIs. -
Working with filesystems in Node.js
Node's fs module gives you a great cross-platform toolkit for working with filesystems. With a few third-party modules it becomes everything you need -
Let tools define JavaScript style
JavaScript's permissive syntax means style debates are easy to run into. This post details how tools can be used to encapsulate your opinion and how this can be integrated into a build process.