48

First of all, there's no proper usage guidance for , as can be seen in the tag wiki:

Representational state transfer (REST) is a style of software architecture for distributed hypermedia systems such as the World Wide Web.

The tag wiki also contains two URLs (and the second one returns 404):

http://en.wikipedia.org/wiki/Representational_state_transfer

How I explained REST to my wife


Besides the vague usage guidance, seems to be a wrong technical term coming from the idea that URIs should be meaningful and express semantics to the client in REST applications. It's a misconception.

Roy T. Fielding defined the REST architectural style in the chapter 5 of his dissertation. This document defines a set of constraints that must be followed by applications that follow such architecture and it doesn't enforce any URI design.

When designing REST APIs, however, it's a common approach to use nouns instead of verbs in the URI: REST is meant to be designed around resources, which are manipulated using representations according to the semantics of the HTTP methods. While user-friendly URIs might be desireable, they are by no means mandatory from the REST architectural style perspective. The URI itself won't make the API more or less RESTful.

Having said that, if such thing as exist, what do non-RESTful URLs are like?


I've seen a previous discussion to add as a synonym of . It's probably not a good idea, once the term comes from a misconception. It even makes me think that should be blacklisted.

More suitable alternatives to would be and .

15
  • 4
    +1. I can't see this ever being useful where rest wouldn't suffice. Commented Nov 8, 2018 at 11:32
  • 1
    A very big +1 from my side as well. @MichaelBerry From my experience I'd state it is used more in terms of api-design or url-design rather than rest actually Commented Nov 8, 2018 at 11:52
  • 3
    While I agree that this tag is bad, I think it's a mistake to bring Fielding's dissertation into it. I've never been able to make any sense of what Fielding's definition of REST is meant to be, but it sure as heck isn't what gets called "REST" by actual practicing web developers (as Fielding likes to point out). As far as I've ever been able to tell, true Fielding-defined REST is an incoherent mess of vague and sometimes impossible requirements, that no web API ever written has satisfied.
    – Mark Amery
    Commented Nov 8, 2018 at 14:09
  • why do we even have *-design?! Commented Nov 8, 2018 at 14:17
  • @MarkAmery Is the Web a mess? Sure, it is. But is error-resilient and scalable. It allows servers to change stuff in their namespace at any time, which allows the creation of content on the fly. Clients in general are quite robust and able to deal with a plethora of different media formats. These are all very strong benefits in distributed computing. REST just generalizes these ideas. That REST is more or less confused with URI/API design, especially for HTTP-based RPC APIs, is a problem on its own Commented Nov 8, 2018 at 14:32
  • 1
    @RomanVottner I disagree. Just look at the requirements Fielding lays out at roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven; they're nuts! How can anyone write code to interface with one of these true REST APIs in which the URL structure, names of resources represented, and even communication protocol used to interact with the API can be changed by the server at any time? A website can have those properties, and humans can adapt on the fly, but it seems to me that having them renders a system useless to robots and not an "API" as programmers understand that term.
    – Mark Amery
    Commented Nov 8, 2018 at 15:02
  • What exactly do you find nuts? The interface is already given by HTTP and there are plenty of implementations available therefore. Link relation names should be used to lookup the URI to invoke. The link-relation name is constant while the lookudup URI might change between calls. IANA even maintains a set of standard link relation names though they might even be specified in media types and other standards. The coupling part between client and server is the media type which defines the syntax and semantic of messages Commented Nov 8, 2018 at 15:32
  • It's the problem of plenty of so called REST frameworks that they either do not support link-relations, media-types or content-type negotiation well enough, not RESTs generic definition. If you prefer your RPC-like Web API, feel free to continue it, just don't call it REST API then. Commented Nov 8, 2018 at 15:38
  • @RomanVottner "The interface is already given by HTTP" - except that literally Roy's first bullet point says that the API should "allow any URI scheme", so somehow the system is meant to seamlessly support non-HTTP resources. "What exactly do you find nuts?" - the idea that clients aren't supposed to use an out-of-band object model, among other things. I can't imagine any way to write useful clientside software to interact with an API - save perhaps "human-driven" software like a web browser - without knowing the object model or even what protocol to use in advance.
    – Mark Amery
    Commented Nov 8, 2018 at 16:33
  • @MarkAmery The space in comments is limited hence I only mentioned HTTP. Of course links may contain URIs using other protocols than HTTP, i.e. S/FTP download links or links to open your mail client and create a respone. The problem with out-of-band information is that it directly couples the client to the API. Changing anything at free will in your response format and plenty of clients might break. Plenty of old APIs must not change as clients directly implemented their API and expect responses in certain formats (typed resources). This is a pain to maintain and also exposes security concerns Commented Nov 8, 2018 at 17:26
  • By standardizing the exchanged message formats you litterally couple to that format instead of the peer. If you need changes in your message format either introduce a new mime type or define the media type that it remains backward compatible (like HTML). A common misconception is that the API needs to be versioned when actually the message format exchanged needs to be. Your browser is as much of an application as a Java, C# or what else application. There are also some robots/agents that are able to interact with your browers, why shouldn't this not be possible in applications as well? Commented Nov 8, 2018 at 17:29
  • Regarding blacklisting: my understanding is that the system for handling blacklisted tags is not very efficient and gets slower every time a new tag is added to it, so it's reserved for especially problematic cases. This almost certainly wouldn't qualify. Commented Nov 8, 2018 at 20:40
  • 1
    I'm just here to say: I really love the titles of these tag-removal topics : D
    – Daniel
    Commented Nov 9, 2018 at 14:29
  • 1
  • 1
    Huh, not only is the one link 404, its been 404 for a year (nov 2017) and that's the only archive Archive.org has of the page. Commented Nov 10, 2018 at 22:05

1 Answer 1

4

I agree that to me doesn't make any sense. I invalidate it in two ways.

No questions asked

What are the questions which are specific to which are not related to or ? I can look at http://acme.com/api/v2/foo and say it's a RESTful URL. Fine. (Actually no, but see second point.) However, what questions am I going to ask about the "RESTful URL"? The questions are either about the URL itself, and then it's a generic URL question. Or the questions are about actually using the URL, or the interaction of the usage with parts of the URL, like path parameters and versions. But then these questions are questions or questions.

What does it even mean?

Also, a URL cannot be RESTful, an API can be RESTful, so what does "restful URL" even mean? Sure, we say that to actually mean "URL of a RESTful API". Back to "No questions asked".

Do we have tags for synonyms?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .