REST: I don't Think it Means What You Think it Does • Stefan Tilkov • GOTO 2014

GOTO Conferences · 71K views · 2014 · 52:27

Open on YouTube

Software architecture & designWeb developmenttalk

Why Stack Overflow recommends it

Stack Overflow users link it when answering REST API design questions, to show that URI spelling and verb choice are not what make an API RESTful and that hypermedia-driven state transitions are.

Recommended by 5 people across 14 different months, 2015 to 2025.

What it is

A conference talk from GOTO Amsterdam 2014 in which Stefan Tilkov of innoQ argues that most APIs marketed as REST do not meet the actual architectural style. He covers what REST really requires, including hypermedia and decoupling clients from servers, and what the label is commonly misused for.

What people said

Strong rec Roman Vottner · 2019-08 · Stack Overflow · on “Terminology question: API somewhere between SOAP and REST - what is the name for them?”

If you take a look at all those so-called REST-APIs your observation might seem true, though REST actually is something completely different. It describes an architecture or a philosophy whose intent [LINK] it is to decouple clients from servers, allowing the latter one to evolve in future without breaking clients. It is quite similar to the typical Web page interaction in that a server will teach a client on what it needs and only reacts on client-triggered requests. One has to be pretty careful and pendant when designing REST services as it is too easy to include a coupling that may affect clients when a change is introduced, especially with all the pragmatism around in (commercial) softwa

Recommends MStodd · 2015-07 · Stack Overflow · on “Best practice for partial updates in a RESTful service”

It doesn't matter. In terms of REST, you can't do a GET, because it's not cacheable, but it doesn't matter if you use POST or PATCH or PUT or whatever, and it doesn't matter what the URL looks like. If you're doing REST, what matters is that when you get a representation of your resource from the server, that representation is able give the client state transition options. If your GET response had state transitions, the client just needs to know how to read them, and the server can change them if needed. Here an update is done using POST, but if it was changed to PATCH, or if the URL changes, the client still knows how to make an update: { "customer" : { }, "operations": [ "update" : { "meth

Recommends VoiceOfUnreason · 2017-02 · Stack Overflow · on “Conflicting REST urls”

This simplified example shows a problem occurs when an object has id "summary". What is the best way to solve this? From a REST puritan perspective, what should be the solution? As far as REST is concerned, the URI are opaque. Spelling is absolutely irrelevant. You could use URI like /a575cc90-2878-41fe-9eec-f420a509e1f0 /f871fff6-4c4e-48f7-83a4-26858fdb3096 and as far as REST is concerned, that's spot on. See Stefan Tilkov's talk REST: I Don't Think It Means What You Think It Does [this video] . What you are asking about is URI design , how to adapt conventions/best practices to your particular setting. One thing that will help is to recognize is that summary is a resource , in the REST/HTTP sen

Recommends VoiceOfUnreason · 2017-09 · Stack Overflow · on “RESTful, a fit for all?”

Does REST architecture fit for all cases? Here's Roy T Fielding, writing in 2008 [LINK] REST is intended for long-lived network-based applications that span multiple organizations. If you don’t see a need for the constraints, then don’t use them. But that doesn't seem to be what you are asking In pre-REST era I'd write something like this.... Perfectly fine. REST doesn't care what spelling you use for your identifiers. The server has complete discretion to encode information into the identifier for its own exclusive use. [LINK] Perfectly fine, as far as REST is concerned. So is wwww.prerest.com/223d17c3-6f6a-42b6-9ddd-599df9811ad4 If I do decide to write a verb based API, like the one above,

Recommends VoiceOfUnreason · 2017-10 · Stack Overflow · on “REST API Designing Endpoints (Action/Verb => Noun/Resource )”

According to this guide of designing REST API endpoints, we should never use action/verbs in URL REST doesn't care what spellings you use for your identifiers. That's part of the point. /e25928c5-7b4e-44b8-be83-24ed9c9f8d3b is a perfect fine identifier. Stefan Tilkov [this video] gave a really good talk on this. Please guide me how should I proceed in such scenario. Think about how you would do it with a website . You would be on a page somewhere, with a bunch of links, one of which had a label on it like changeTheme. You would click that link, and be presented with a new page that included a form, with a list of available themes. You would pick the theme you want from the list, and submit the fo

Recommends tereško · 2017-11 · Stack Overflow · on “If an API only provides POST requests functions, is it RESTful?”

You should probably watch this lecture [this video] and read this article [LINK] . REST a such has nothing to do with how much of available HTTP methods you use. So, the quick answer is: yes, it could be considered "restful" (whatever that actually means). Buuut ... it most likely - isn't . And it has nothing to do with the abuse of POST calls. The main indicator for this magical "RESTfulness" has nothing really to do with how you make the HTTP request (methods and pretty URLs are pointless worthless as a determining factor ). What matters is the returned data and whether, by looking at this data, you can learn about other resources and actions, that are related the resource in any given endpoint

Recommends tereško · 2017-11 · Stack Overflow · on “Naming a GET with alternative query options”

Since there is no actual overlap between email addresses and IDs. I would just use same endpoint for both. Especially if GET /users/{id} is already a published interface. So, I would go with 1st method. GET /users/{identifier} Then on the API server you have to add a small check, whether {identifier} is a number or not. I would also like to note, that "pretty URLs" do not make it REST :) You probably will want to watch this lecture: [this video]

Recommends tereško · 2017-11 · Stack Overflow · on “How to organize Symfony 3 Code to work with complex JSON API endpoints?”

I am getting an impression, that you are trying to turn your API in something like "SQL over HTTP". That's will obviously create something of clusterfuck, due to the amount of optional parameters. You probably should read this article [LINK] and watch this lecture [this video] on the given subject. I personally prefer the endpoints to always return the same fields and use the parameters, when I need to expand [LINK] one (or more) of those fields, or when the endpoint contains a collection and I want to filter/paginate the results. That way the "parsing" of user's request becomes a lot simpler. It also seem, that your "include" field provides a way for user to reach in the DAL and directly fiddle

Recommends tereško · 2018-09 · Stack Overflow · on “Routing for api REST in php mvc”

You really should watch this lecture [this video] and read this article [LINK] . Also, just because you call something "controller" does not make it MVC.

Recommends VoiceOfUnreason · 2018-12 · Stack Overflow · on “REST API design for action that is not REST”

[LINK] I know that is not REST compatible and I'm looking for suggestions to make it the right way. It is REST compatible. REST doesn't care what spellings you use for your resource identifiers. Would it be great architecture and REST compatible? If this is what you want, think about how you would achieve the same result with a website. The client would open a bookmark in a browser, maybe follow some links, fill in a form, and submit it. That would all work because the (generic) browser understands the processing rules for HTML, and how to manage cache meta data in HTTP, and so on. There's no point in the chain where the client needs to compose an identifier -- it either uses one provided by