• Slotos@feddit.nl
    link
    fedilink
    arrow-up
    5
    ·
    1 month ago

    While HTML is hypertext markup language, hypertext is not HTML.

    Hypertext doesn’t imply a specific encoding strategy, it implies semantics - data contains links to related data. If you want to encode it in protobufs - you do you, REST explicitly calls for freedom in this regard.

    To paraphrase yourself, ranting about HTML as if it was a requirement for REST is ridiculous and misses the point entirely.

    PS: HTML is not a protocol.

    • tyler@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      27 days ago

      Yeah which you can do with JSON as well. GitHub’s API does exactly that, providing links to all the rest of the resources so the client doesn’t need to “know anything”.

      The author of the article completely conflates JSON with “JSON == Not-REST” which couldn’t be further from the truth (also calling json apis “RPC” is fucking hilarious to me. I can tell the author has never touched actual RPC). JSON was standardized on because it encoded the information that was in html in a much smaller format and allowed a backend server to communicate with any client, not just a browser (not that other clients can’t use html or xml, but they didn’t want to because they might not be documents). Dealing with xml is a nightmare. JSON made that better, and still allowed you to do HATEOS if you really wanted to.