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

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




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: