U盘PE| w764位旗舰版下载 | U盘装win7系统 | U盘启动 |win7pe | win10下载 |加入收藏土豆PE官网U盘PE,U盘装win7系统,win7pe,U盘启动,U盘装系统,w764位旗舰版下载站!
当前位置:主页 > 帮助中心 > 土豆PE使用教程 >

Endpoints and Payloads - Organizing API endpoints ...

来源:http://www.tudoupe.com时间:2022-01-02

When organizing API endpoints, they should be based on the resources instead of on actions. The request methods will determine what action should be taken at a given URL endpoint. Your entire API’s scheme should be consistent, clear and concise.

API的终点究竟是什么?
In simple terms, an API endpoint is the point of entry in a communication channel when two systems are interacting. It refers to touchpoints of the communication between an API and a server. The endpoint can be viewed as the means from which the API can access the resources they need from a server to perform their tasks. An API endpoint is basically a fancy word for a URL of a server or service.

APIs operate through ‘request’ and ‘response’. And when an API requests to access data from a web application or server, a response is always sent back. The location where the APIs sends a request and where the response emanates is what is knowns as an endpoint. Reputedly, the endpoint is the most crucial part of the API documentation since it is what the developer will implement to make their requests.

An API refers to a set of protocols and tools that allow interaction between two different applications. In simple terms, it is a technical that enables third-party vendors to write programs that can easily interface with each other. On the other hand, an endpoint is the place of interaction between applications. API refers to the whole set of protocols that allows communication between two systems while an endpoint is a URL that enables the API to gain access to resources on a server.

API 终端点优势

  • Should be intuitive
  • Organize by resource
    • Use nouns in the path, not verbs
    • The method used will determine the operation taken
    • GOOD:
      • https://example.com/posts
    • BAD:
      • https://example.com/get_posts
  • Keep a consistent scheme
    • Plural nouns for collections
    • Use parameters to specify a specific item
    • GOOD:
      • https://example.com/entrees
      • https://example.com/entrees/5
    • BAD:
      • https://example.com/entree
      • https://example.com/entree_five
  • Don’t make them too complex or lengthy
    • No longer thancollection/item/collection
    • GOOD:
      • https://example.com/entrees/5/reviews
    • BAD:
      • https://example.com/entrees/5/customers/4/reviews
Resource GET POST PATCH DELETE
/tasks Get all tasks Create a new task Partial update of all tasks Delete al tasks
/tasks/1 Get the details of task 1 错误! 因为背面有它 Partial update of task 1 Delete task 1
/tasks/1/notes Get all the notes for task 1 Create a new note for task 1 Partial update of all notes of task 1 Delete all notes of task 1

Copyright © 2012-2014 Www.tudoupe.Com. 土豆启动 版权所有 意见建议:tdsky@tudoupe.com

土豆系统,土豆PE,win7系统下载,win7 64位旗舰版下载,u盘启动,u盘装系统,win10下载,win10正式版下载,win10 RTM正式版下载,win8下载,电脑蓝屏,IE11修复,网络受限,4K对齐,双系统,隐藏分区,系统安装不了,U盘装系统,笔记本装系统,台式机装系统,diskgenius运用,GHSOT装系统,U盘修复,U盘技巧,U盘速度,U盘不能格式化,U盘复制发生错误,U盘加密,U盘选购,开机黑屏,蓝屏,进不了系统,上不了网,打不开程序,点击无反应,系统设置,PE个性化,PE添加网络,PE维护系统

点击这里给我发消息