I'm developing a website, and have not no idea on how to design good URL(need to avoid queries like ?userId=123
).
These are what I'm going to do
all posts:
/posts
all my posts
/:userI/posts ??
/posts/:userI ??
get all posts of userA
/:userA/posts ??
/posts/:userA ??
get one post
/posts/:postID
create a new post
/posts/new
edit a post
/posts/:postID/edit
Is there any best practices?
It looks good, however, you might face a little trouble with :-
get one post
/posts/:postID
Change it to
/posts/:userA/:postID
I did it so because you might want to link a post to a user for some security reasons in your application.