当前位置:网站首页>[development team follows] API specification
[development team follows] API specification
2022-07-04 02:44:00 【ReactSpring】
URL Use horizontal bars to separate words
/system-ordersThe parameters are named after the small hump
/system-orders/{orderId}Get the plural words used in the collection
GET /usersURL Don't use verbs in it
PUT /user/{userId}JSON The attribute is named after the small hump
{ userName: "Mohammad Faisal" userId: "1" }The response body should contain the number of resources
{ users: [ ... ], total: 34 }stay GET Always accept... In operation limit and offset Parameters
GET /shops?offset=5&limit=5
- Add one fields Parameters , Public only API Required fields in
Return only the name of the store , Address and contact information .
GET /shops?fields=id,name,address,contact
adopt HTTP Ask the head to carry Token
Authorization: Bearer xxxxxx, Extra yyyyyAlways verify content type
```api
content-type: application/json
```
Yes CRUD Function USES HTTP Method
GET: Retrieve the representation of the resource . POST: Create new resources and sub resources . PUT: Update existing resources . PATCH: Update existing resources , It only updates the fields provided , Without updating other fields . DELETE: Delete existing resources .In nested data URL Use in HTTP Method
GET /shops/2/products: from shop 2 Get a list of all products . GET /shops/2/products/31: Get product 31 Details of , product 31 Belong to shop 2. DELETE /shops/2/products/31: Products should be deleted 31, It belongs to the store 2. PUT /shops/2/products/31: Products should be updated 31 Information about , Only in resource-URL Upper use PUT, It's not a collection . POST /shops: A new store should be created , And return the details of the new store created . In collection url Upper use POST.CORS Cross-domain resource sharing
It must be for all public oriented API Support CORS( Cross source resource sharing ) Head . Consider support CORS Allow the “*” source , And through effective OAuth Token forced authorization . Avoid combining user credentials with original authentication .Security
At all endpoints 、 Implement on resources and services HTTPS(tls encryption ). Force and require all callbacks url、 Push notification endpoint and webhooks Use HTTPS.General principles
Flat is better than nested . Simplicity is better than complexity . Strings are better than numbers . Consistency is better than customization .
边栏推荐
- 長文綜述:大腦中的熵、自由能、對稱性和動力學
- How to subcontract uniapp and applet, detailed steps (illustration) # yyds dry goods inventory #
- Example 073 square sum value judgment programming requires the input of a and B, if a ²+ b ² If the result of is greater than 100, a is output ²+ b ² Value, otherwise output the result of a + B.
- The boss said: whoever wants to use double to define the amount of goods, just pack up and go
- Career development direction
- Question C: Huffman tree
- Résumé: entropie, énergie libre, symétrie et dynamique dans le cerveau
- Crawler practice website image batch download
- Mysql to PostgreSQL real-time data synchronization practice sharing
- [Yugong series] February 2022 attack and defense world advanced question misc-84 (MySQL)
猜你喜欢

How to subcontract uniapp and applet, detailed steps (illustration) # yyds dry goods inventory #

Redis transaction

Advanced learning of MySQL -- Application -- index

Jenkins continuous integration environment construction V (Jenkins common construction triggers)

Buuctf QR code

Node write API
![Measurement fitting based on Halcon learning [4] measure_ arc. Hdev routine](/img/3a/cf6285ae1c01bda42874eeca9fe5b1.jpg)
Measurement fitting based on Halcon learning [4] measure_ arc. Hdev routine

Ai aide à la recherche de plagiat dans le design artistique! L'équipe du professeur Liu Fang a été embauchée par ACM mm, une conférence multimédia de haut niveau.

MySQL advanced SQL statement (1)

Lichuang EDA learning notes 14: PCB board canvas settings
随机推荐
長文綜述:大腦中的熵、自由能、對稱性和動力學
How to subcontract uniapp and applet, detailed steps (illustration) # yyds dry goods inventory #
3D game modeling is in full swing. Are you still confused about the future?
在尋求人類智能AI的過程中,Meta將賭注押向了自監督學習
13. Time conversion function
Jenkins continuous integration environment construction V (Jenkins common construction triggers)
Fudan released its first review paper on the construction and application of multimodal knowledge atlas, comprehensively describing the existing mmkg technology system and progress
The "two-way link" of pushing messages helps app quickly realize two-way communication capability
A. ABC
WordPress collection WordPress hang up collection plug-in
Contest3145 - the 37th game of 2021 freshman individual training match_ E: Eat watermelon
Li Chuang EDA learning notes 13: electrical network for drawing schematic diagram
Talking about custom conditions and handling errors in MySQL Foundation
Practical multifunctional toolbox wechat applet source code / support traffic master
Global and Chinese market of cell scrapers 2022-2028: Research Report on technology, participants, trends, market size and share
16. System and process information
Chain ide -- the infrastructure of the metauniverse
中電資訊-信貸業務數字化轉型如何從星空到指尖?
Package and download 10 sets of Apple CMS templates / download the source code of Apple CMS video and film website
Question C: Huffman tree