Design specification of API interface based on HTTP standard protocol

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

Development specifications

    1. Version control git

    2. Development process Git flow

Interface

Request Method URL Action Chinese Description
GET /resources/ List List
POST /resources/ Create Create
GET /resources/:id Retrieve With
PUT /resources/:id Update Update
PATCH /resources/:id Partial_update Partial update
DELETE /resources/:id Destroy Delete

Data

    1. Request Support Form-date,json,x-www-form-urlencode

    2. Return format uniform to JSON

    3. One request corresponds to a serializer

Error

    1. The error message is contained in the returned content.

    2. Different errors correspond to different error message codes

    3. HTTP error codes are used in standard usage

Certification

    1. Jwt

    2. Token

    3. Oauth2

Permissions

    1. In the form of middleware as a privilege identification plug-in, according to the HTTP request format directly Judge permissions

    2. User information and permission information cache are guaranteed to be efficient when the user logs on successfully

Log

    1. Logs are provided in the form of middleware

    2. According to the business requirements of the atmosphere inventory log and normal log

Documentation (to be perfected)

Write the document according to the interface format above

{  "resources": {    "list": {      "params": {},      "response": {}    },    "create": {      "request": {},      "response": {}    },    "retrieve": {      "response": {}    },    "update": {      "request": {},      "response": {}    },    "partial_update": {      "request": {},      "response": {}    },    "destroy": {}  }}

Test

Business Required interface test coverage 100%

Deployment

    • Docker

    • Docker-compose

    • Docker-machine

    • Docker-swarm

Server Resource Monitoring

Ready to be perfected

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.