Skip to content
HomeVideosBooks
AllTopicsTrends
BlogsPodcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    Cover of RESTful Web APIs

    RESTful Web APIs

    Leonard Richardson, Michael Amundsen, Sam Ruby · 2013

    The popularity of REST in recent years has led to tremendous growth in almost-RESTful APIs that don’t include many of the architecture’s benefits. With this practical guide, you’ll learn what it takes to design usable REST APIs that evolve over time. By focusing on solutions that cross a variety of domains, this book shows you how to create powerful and secure applications, using the tools designed for the world’s most successful distributed computing system: the World Wide Web. You’ll explore the concepts behind REST, learn different strategies for creating hypermedia-based APIs, and then put everything together with a step-by-step guide to designing a RESTful Web API. Examine API design strategies, including the collection pattern and pure hypermedia Understand how hypermedia ties representations together into a coherent API Discover how XMDP and ALPS profile formats can help you meet the Web API "semantic challenge" Learn close to two-dozen standardized hypermedia data formats Apply best practices for using HTTP in API implementations Create Web APIs with the JSON-LD standard and other the Linked Data approaches Understand the CoAP protocol for using REST in embedded systems

    Web & Internet
    Open LibraryAmazon
    Stats for nerds
    7recommend
    12mentions
    11people
    2014–2022years
    67% recommend33% neutral

    Mentions per year

    201420152016201720182019202020212022

    What Hacker News says

    1. brigandishMar 2022
      The classic book on the subject is RESTful Web APIs[1], and it spends a while explaining HATEOAS by using the example of the web as we've come to expect it as the exemplar REST API using HATEOAS. I also have this essay[2] on HATEOAS in my open tabs, and it uses the example of a web browser fetching a web page.

      [1] https://www.oreilly.com/library/view/restful-web-apis/978144...

      [2] https://htmx.org/essays/hateoas/

      thread
    2. irene_tFeb 2021
      Hey, check out this book, should be helpful https://www.amazon.com/RESTful-Web-APIs-Services-Changing/dp...
      thread
    3. macca321Apr 2019
      There's two kinds of REST. REST as most developers misunderstand it, and REST as Roy Fielding, inventor of REST, understands it.

      For the former you can read the Microsoft REST guidelines, for the latter I suggest getting Mike Amundsen's RESTful Web APIs book.

      If you do go with the latter be prepared for a lot of frustration with those who went with the former.

      thread
    4. JimDabellMay 2018
      It's pretty simple – the information a client needs to transition from one state to another needs to be encoded in the documents. So if you were to design a garage door opener, a non-REST specification might say something like:

          To get the door status, GET https://example.com/status  
          
          To open the door, POST to https://example.com/open  
          
          To close the door, POST to https://example.com/close
      
      A REST approach might use a document something like this:

          {
              "doorState": "closed",
              "actions": [
                  {
                      "label": "Open the door",
                      "href": "/open",
                      "method": "POST"
                  }
              ]
          }
      
      Then, upon a client performing an "Open the door" action, the server would then respond with a document like this:

          {
              "doorState": "open",
              "actions": [
                  {
                      "label": "Close the door",
                      "href": "/close",
                      "method": "POST"
                  }
              ]
          }
      
      …and vice-versa. So at any given point, the web service is describing to the client what the state is and how to transition to other states. There's quite a few different benefits to doing it this way – for instance, if you wanted to add a "Turn the garage light on" feature, you could just add the action into the API and clients would be able to use it without any changes whatsoever. Or if you wanted to disable an action, you'd simply remove it from the actions array and the client wouldn't present it to the user as an option. Want to A/B test different label text? You don't need any special A/B testing functionality in the client, just vary the responses you send to users and observe which actions they take. Want to translate into different languages? Just take a look at the Accept-Language header coming from the client and respond with the right label text.

      In practice, you'd want to use a vocabulary that's already out there like Hydra instead of coming up with your own format. But it can sometimes take a little time to get up to speed with them because they are necessarily quite flexible. But you can get most of the way there by simply thinking about it in terms of "the server tells the client what to do and how to do it".

      For something as simple as a garage door that you are certain will never need to change? The benefits REST brings probably aren't going to be worth much to you. But as the complexity of an API grows, the point at which it's easier to use REST than not arrives very quickly.

      If you want to read more about this, the best book I've found on the subject is RESTful Web APIs: http://restfulwebapis.com/

      thread
    5. JimDabellAug 2016
      I think it depends on what type of API you'd like to design.

      If you're talking about REST APIs, then the best book I've come across is RESTful Web APIs by Leonard Richardson and Mike Amundsen:

      http://restfulwebapis.org/

      It actually shows you how to do REST properly, not that shoddy knock-off REST that some people push, where you have to document all your URI structures and hard-code them in your clients. There's solid examples that you build upon throughout each chapter, and jumping off points to standardisation work like JSON-LD etc.

      thread
    6. tom_bNov 2014
      Yes. As a hacker who leans on books, blogs, and well-defined principles, RESTful api design resources have often been much more http RPC oriented.

      Hackers should pay attention to:

      http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hyperte...

      I have also found collection+json and hypermedia application language (HAL) to be useful.

      Plus, I have spent a bunch of time reading the Restful Web APIs book from O'Reilly. Useful for me, as a relative newbie, in providing some logical foundation to start from . . .

      thread

    Related

    Cover of RESTful Web Services
    2007–2025

    RESTful Web Services

    Leonard Richardson
    13 recommend · 26
    Cover of Design of Web APIs
    2019–2020

    Design of Web APIs

    Arnaud Lauret
    3 recommend · 4
    Cover of REST API design rulebook
    2013–2022

    REST API design rulebook

    Mark Massé
    2 recommend · 4
    Cover of Building Hypermedia APIs with HTML5 and Node
    2012–2016

    Building Hypermedia APIs with HTML5 and Node

    Michael Amundsen
    2 recommend · 3
    Cover of Designing Web APIs
    2019

    Designing Web APIs

    Brenda Jin
    1 recommend · 2
    Cover of Ruby on Rails tutorial
    2009–2026

    Ruby on Rails tutorial

    Michael Hartl
    205 recommend · 314
    Hypermedia SystemsCarson Gross
    2023–2026

    Hypermedia Systems

    Carson Gross
    recommend · 33
    22
    Cover of Building Scalable Web Sites
    2007–2026

    Building Scalable Web Sites

    Cal Henderson
    14 recommend · 22