On the naming Specification of Special Interface restful

1. When designing the interface of the login page, how should the login page interface URI be designed so that the front end can see the login-related tables directly from URL? What if the user table name for login is users, login interface URI is-/ users?login=1 or / users/login, do not know if there is a conventional design?

2. I want to design a URI for search engines. How do you do it? can you design it like this:

news/news_text/search?keyword={}

3. Is there no security risk in designing URI, according to restful specification to expose database table names in URL?


uri corresponds to the back-end interface. You don't need to tell the front end which data table to communicate with in the interface. The
interface has nothing to do with the data table, much less should it be exposed to the front end. In


restful, uri refers to resources, which has nothing to do with tables. A uri corresponds to a resource or a pile of resources. Users and search engines are two different resources, so they should be two interfaces.


  1. should not expose table names to the outside world.
  2. semantic URL, is best in line with business logic and page model structure, and makes people feel naturally
  3. .
  4. if it is a function, use the URL path, if it is a parameter, use the URL querystring, complex parameter, use post body.
  5. take full advantage of http method and http status.

users . As a plural expression, it has deviated from semantics for a single user.

news/news_text/search , as far as search is concerned, put it directly into news/search .

Menu