How to name the logon interface in RESTful?

Source: Internet
Author: User
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...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.