Interface specifications: 1. HTTPs is used to ensure the security of interactive data transmission 2. Whenever possible, the API should be deployed under a private domain name, such as api.example.com 3. Should the API version number in the URL, such as: https://api.example.com/v {n} / 4. Web sites can’t have verbs, only nouns, and the nouns usually correspond to the table names in the database. Generally speaking, the tables in the database are the same record of “set” (collection), so the API also should use the noun in the plural, such as: api.example.com/v1/products 5. The specific types of resource operations are represented by HTTP verbs, and there are four commonly used HTTP verbs. GET (SELECT) : Retrieves one or more resources from the server. POST (CREATE) : Creates a resource on the server. PUT (UPDATE) : Updates the resource on the server (the client provides the full resource after the change). DELETE (DELETE) : deletes resources from the server. 6. If there are many records, the server cannot return them all to the user. The API should provide parameters that filter the return results. Here are some common parameters. ? Limit =10: Specify the number of records to return? Offset =10: Specifies the start of the return record. ? Page =2&per_page=100: Specifies the number of pages and the number of records per page. ? Sortby = name&ORDER = ASC: Specifies by which attribute the return results are sorted, and in what order. ? Producy_type =1: specify filter criteria 7. 1) Address bar parameters * restful Address bar parameters/API /v1/product/122 122 indicates the product number. Get product 122 information * Get query string see filtering information section 2) Request body data 3) Cookie 4) Request Header Cookies and headers are generally used for OAuth authentication 8. Return the data interface returns the template: {status: 0, data: {} | | [], MSG: “\

}

\

Note: Welcome to join the QQ group of web front-end job hunting and recruitment: 668352707

\