Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I also strongly disagree. The real problem is that browsers can't use them as good as they should. If you take for example a RESTful API, the verbs make totally sense and especially one of the mentioned verbs. PATCH is a great verbs if you use it like it was specified. I personally like the idea of giving more freedom to chose the verbs. Imagine you could use for a Twitter API something like: FOLLOW /users/123


> The real problem is that browsers can't use them as good as they should

That's the obvious inevitability of having too many superfluous options. And one of the main thrusts of the article.


Yes, but people disagree on the "superfluous" part.


Yes, it would be horrible if you instead had to do: POST /user/123/follow


PUT /myuser/following/theiruser


PUT /user/123 { id: 123, following: { foo, bar, baz } }


  PUT /user/123/following

    /user/foo
    /user/bar
    http://www.other-site-using-standard-formats.com/user/baz
Sigh, if only.


Yeah, if that's where your URL ended. But what if your URLs kept going? Say you had

    /user/123/followers
or

    /user/123/followers/followers
or

    /user/123/followers/followers/following
? When your URLs have a non-obvious terminus (as is typical of proper REST APIs) it becomes clear that the verb does not belong in the URL path.


So you're saying that we should have a verb instead?

FOLLOWERS_FOLLOWERS_FOLLOWING /user/123


No, the verb is FOLLOW, as in the example you were responding to:

    FOLLOW /user/123/followers/followers/following


The HTTP specification in no way restricts the verbs that you can use to those that are in common use. But at some point somebody, somewhere, decided that the only ones allowed were the ones that the specification explicitly mentioned. And so people just shoehorn their applications into frameworks built around what the HTTP specification defines, rather than allows.

Ain't nobody got time for defining semantics.


Javascript can use them just fine. Browsers without JS can't do a lot of useful things, that's why JS exists.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: