Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Choose URLs #108

Open
psimonyi opened this issue Mar 28, 2013 · 11 comments
Open

Choose URLs #108

psimonyi opened this issue Mar 28, 2013 · 11 comments

Comments

@psimonyi
Copy link
Contributor

In #102, we started discussing what form the /do URLs should have.

@spratt
Copy link
Member

spratt commented Mar 28, 2013

I don't really like the /do part. It is really just something short I used to proxy to the back-end.

I would like the following URLs to respond to GET requests:

  • /code/unique-universial-identifier
  • /comment/count/unique-universial-identifier
  • /comments/unique-universal-identifier/8

And the following URLs to respond to POST requests

  • /new/code
  • /new/comment

And the following URLs to respond to OPTIONS requests

  • /new/code

@spratt
Copy link
Member

spratt commented Mar 28, 2013

Maybe replace /do with /object ?

So the full url would be:

http://review.steamedpears.com/object/new/code

or

http://review.steamedpears.com/object/code/unique-universal-identifier

@cdelahousse
Copy link
Member

From our discussion before the shit fest that was last Thriday:

We agreed /api/ is better than /object/

For getting content:
/api/code/ or /api/code/uuid with a get request.

For adding content:

  • Simon likes /api/new/code with a post request.
    • Pro: explicit
    • con: lack of symmetry with the get resource.
  • Bhee and Christian like /api/code with a put or post request
    • Basically, you're getting and setting to the same resource using differnt HTTP verbs
    • Pros: 1) to the best of my knowledge, it's more restful and adheres to those norms. (TODO: look that up). 2) more symmetric
    • Con: less explicit

@spratt
Copy link
Member

spratt commented Apr 1, 2013

Just to clarify, I suggest we get from /api/code/universal-unique-identifier and we push to /api/new/code.

@psimonyi
Copy link
Contributor Author

psimonyi commented Apr 3, 2013

+1 for /api. I like the idea of /api/code/new better than /api/new/code (cf. /api/code/<id>).

@spratt
Copy link
Member

spratt commented Apr 3, 2013

Alright. I like that it's explicit. I prefer <verb> <noun> like in English, but I can agree to this.

@spratt
Copy link
Member

spratt commented Apr 3, 2013

Also, I think of new as a verb.

@psimonyi
Copy link
Contributor Author

psimonyi commented Apr 3, 2013

<verb> <noun> works, but URIs are hierarchical: the more general thing comes first. (/api/newcode would be okay.)

@psimonyi
Copy link
Contributor Author

psimonyi commented Apr 3, 2013

On Wed, 2013-04-03 at 14:37 -0700, Simon David Pratt wrote:

Also, I think of new as a verb.
Call it the "action".

@spratt
Copy link
Member

spratt commented Apr 3, 2013

I like /api/code/new better than /api/newcode because the former sounds more like a resource.

@psimonyi
Copy link
Contributor Author

psimonyi commented Apr 4, 2013

I like it better because it's as if "new" is the ID; it's just a magical ID that redirects the POST to a new ID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants