In a RESTful architecture, each website address represents a resource. Therefore, there cannot be any verb in the website, but only nouns, and the nouns used often correspond to the table names in the database. In general, tables in the database are all & quot; sets & quot; (collection) of the same type of records, so the name of the API... in a RESTful architecture, each website address represents a resource. Therefore, there cannot be any verb in the website, but only nouns, and the nouns used often correspond to the table names in the database. In general, tables in the database are all collections of the same type of records, so the nouns in the API should also use the plural.
GET/zoos: list all zoo
POST/zoos: Create a zoo
GET/zoos/ID: GET the information of a specified zoo
PUT/zoos/ID: update the information of a specified Zoo (provide all information about the zoo)
PATCH/zoos/ID: update the information of a specified Zoo (provide some information about the zoo)
DELETE/zoos/ID: DELETE a zoo
The question is, how can I name the logon interface?
Reply content:
In a RESTful architecture, each website address represents a resource. Therefore, there cannot be any verb in the website, but only nouns, and the nouns used often correspond to the table names in the database. In general, tables in the database are all collections of the same type of records, so the nouns in the API should also use the plural.
GET/zoos: list all zoo
POST/zoos: Create a zoo
GET/zoos/ID: GET the information of a specified zoo
PUT/zoos/ID: update the information of a specified Zoo (provide all information about the zoo)
PATCH/zoos/ID: update the information of a specified Zoo (provide some information about the zoo)
DELETE/zoos/ID: DELETE a zoo
The question is, how can I name the logon interface?
POST /logins/
Get sessions/new logon page post sessions/create logon post sessions/destroy logout
Abstracts a session into a resource.
RESTful is just a naming suggestion, not a standardSo you can use login/signup, and the boss won't deduct your salary.
If you must be so delicate, we suggest you change your mind.
Authorize upon logon
Authorization is clear.
Although I sometimes want to be refined .. but it's still a simple and rude place to be rude... because the work is done by everyone .. it would be inappropriate if the whole project is too high-end to make people feel overwhelmed...