- Building RESTful Web Services with PHP 7
- Haafiz Waheed ud din Ahmad
- 260字
- 2021-07-03 00:02:16
Conventions of RESTful web services
RESTful web services are based on RESTful resources. A RESTful resource is an entity/resource that is mostly stored on a server and that client request using RESTful web services. Here are a few characteristics of a resource in terms of RESTful web services:
- It is an entity normally referred as a noun in the URL
- It is unique
- It has data associated with it
- It has at least one URI
If you are still wondering what exactly is a resource, consider the example of a blog. In a blog system, a Post, User, Category, or Comment can be a resource. In a shopping cart, a Product, Category, or an Order can be a resource. In fact, any entity which a client is requesting from the server is a resource.
Most commonly, there are five typical operations which can be performed on a resource:
- List
- Create
- Read
- Update
- Delete
For each operation, we need two things: the URI and HTTP method or verb.
The URI contains a resource name that is a noun and the HTTP method that is a verb. To perform some operation on an entity, we need to have a noun that tells us which entity we need to perform some operation. We also need to specify a verb to tell us what operation we want to perform.
For the preceding mentioned operations, there is a URL convention that we use with HTTP verbs and resource names. In the next section, we will review the URL structure and HTTP verbs for each operation.
- C++面向對象程序設計(第三版)
- Java Web開發學習手冊
- Node.js 10實戰
- 深度學習經典案例解析:基于MATLAB
- C++ Builder 6.0下OpenGL編程技術
- PHP程序設計(慕課版)
- Android 7編程入門經典:使用Android Studio 2(第4版)
- Access 2010數據庫基礎與應用項目式教程(第3版)
- JavaScript從入門到精通(第3版)
- 你不知道的JavaScript(中卷)
- Java EE 7 Performance Tuning and Optimization
- Learning ArcGIS for Desktop
- Learning OpenStack Networking(Neutron)
- 軟件品質之完美管理:實戰經典
- Service Mesh實戰:基于Linkerd和Kubernetes的微服務實踐