Live data from Hacker News

What it means for an API to be RESTful

en.andros.dev

51–59 of 59 posts

Re: What it means for an API to be RESTful

#51
Anyone working in an organisation where teams are trying to map business logic errors into HTTP status codes?

Wasn't Fieldings original dissertation meant as a formalisation of the web? I.e. it had nothing to do with APIs until later, when that became popular in the mid 2000s?

The amount of nonsense conversations / meetings I have been in over the years around designing "RESTful" APIs, endless discussions, I can no longer keep count. Because, unless you're working on an academic research project, everything in REST becomes a compromise.

At this point I am starting believe that REST has done more harm than good for the industry.

Re: What it means for an API to be RESTful

#55
post #3

Well, this inevitable flamewar will be a nice change from the pro-AI / anti-AI comment threads, at least...

Also a fiery Emacs vs Vi flamewar would be a nice palate cleanser right now.

There needs to be a fps or rts for that...

Re: What it means for an API to be RESTful

#56
post #53

The longer I work with and write APIs, the more and more I believe everything should be a POST.

That's actually really correct in the most wrong way possible. I've worked with one too many endpoints that don't care about UPDATE, DELETE, and whatever else beside POST exists, while relying on body data to do the "what department are you looking for" requests.

Re: What it means for an API to be RESTful

#57

Earlier quoted context omitted.

I was referring to that the PATH could just be named /api/comment?... , because comment is already a verb.

URIs/paths are meant to point at resources/documents and therefore ideally should not contain verbs.

Then naming it 'comment' rather than 'add-a-comment' makes even more sense.

Re: What it means for an API to be RESTful

#58

Earlier quoted context omitted.

I was referring to that the PATH could just be named /api/comment?... , because comment is already a verb.

This is exactly the kind of pointless discussion around rest apis

The naming of endpoints is not specific to REST actually.

Re: What it means for an API to be RESTful

#59
post #53

The longer I work with and write APIs, the more and more I believe everything should be a POST.

That's actually really correct in the most wrong way possible. I've worked with one too many endpoints that don't care about UPDATE, DELETE, and whatever else beside POST exists, while relying on body data to do the "what department are you looking for" requests.

Yes, I also balked when I originally encountered this pattern at a previous co.

And I think agree with your point, "correct in a wrong way"? Yeah, everything as a POST is wrong, but it is less wrong and more clear to just ignore REST because the assumptions are broken so often it just makes it more complicated.

Just POST everything and make it clear in the URI + bodies what is happening.

Post reply on HN