← Back to context

Comment by groestl

7 years ago

Just be the guy who says "oh a POST is fine" first

Yeah, full REST is nice, but you can do worse than just using GET and POST as long as GET doesn't change state.

  • Layers of REST that people get to:

    1. GET is good for everything

    2. Perhaps we should use POST too

    3. Let's use all the verbs

    4. Someone mentions HATEOAS

    5. Some old guy says that you've got to use XML because that defines links and JSON doesn't

    6. Someone else counters with JSON-LD and sends a link to the W3 spec

    That's as far as I got. Mostly this conversation happens in my head.

    • So I'm actually really interested in this conversation -- I think it's a good one that everyone has that needs to just get resolved. I think deciding where to follow and how much to follow REST/HATEOAS is exactly what engineering teams should decide. There are escape hatches (POST can do just about anything) and lots of ways to do things but REST-ful (not pure necessarily pure REST) and HATEOAS-y (usually comes up in terms of pagination/relations first) APIs are not bad at all.

      I think JSON+JSON-LD still offers some benefits over XML at the very least in the security sense -- while it can be misused, there are much less dynamic bits built in to the transfer language itself.

      Also I'd say that JSON "scales" well in terms of complexity still, small things are cognitively light, and big things are linearly more cognitively heavy.

      Is JSON+JSON-LD+X the new XML?

      Is Swagger the new WSDL/SOAP?

      I dunno, but it doesn't feel like it's quite that bad yet.

      4 replies →

  • I've had to develop APIs for clients that could only do GET or POST requests. Sometimes you have to sacrifice correctness for what's actually possible.