开发者

Why do most of the people use routes with user id?

I was thinking about one thing. Because of what issued there are so many people who use开发者_如何学Go user 'id' to maintaing operations on, like edit?

Example: I go to www.example.com/user/TestUser/edit to edit my user.

Isn't that better to make routes something similar to this?: www.example.com/user/edit


Maybe look at REST to understand why URLs are constructed this way. In short: The URL http://www.example.com/user/marc is thought to represent the user himself.


I don't think there is an exact answer, however my idea is that www.example.com/user/edit should be normally used for administration pages to edit some user profile. Maybe that's the reason why it's not used in the way you explained.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜