官术网_书友最值得收藏!

Case study - RESTful web service endpoints for a blog

To understand RESTful web services, let's consider the case study of a blog where we will discuss resources/entities in a blog. We will start to define the requirements and endpoints URLs for the blog's resources and then define responses that we should have against those requests. So these endpoints and response definitions will help us understand how RESTful web services endpoint should look like and what the response should be. In the later chapters, we will talk more about the implementation of these endpoints, so these definitions will act as an API document for the next chapters. However, for simplicity, we will keep it minimal for now and later add more attributes to it.

Although based on HATEOAS, a RESTful web service should return links to the next endpoints and there are conventions that tell us about other endpoints but the API document is still important. API consumers (client-side developers) and API providers (server-side developers) should agree on it so that both can work in parallel without waiting for the other. However, in the real world, we don't have to write API document for basic CRUD operations.

In a typical blog, the most common resources are posts and comments. There are others as well but for now, we will discuss these two resources for the sake of understanding RESTful web services. Note that we are not considering authentication related stuff but will look into that in the later chapters.

If client-side and server-side teams are of the same organization, working on a single app, then it is a good idea to get such document created by the client-side team as the server-side team is just the serving client side.
主站蜘蛛池模板: 长子县| 隆回县| 裕民县| 兴山县| 乐安县| 武胜县| 平顶山市| 乐昌市| 资阳市| 郧西县| 民县| 二连浩特市| 定陶县| 赞皇县| 格尔木市| 莒南县| 平南县| 大洼县| 皋兰县| 上林县| 靖江市| 怀宁县| 皮山县| 卢氏县| 清镇市| 乌兰察布市| 太仓市| 湘潭县| 湟源县| 铜鼓县| 二手房| 兴国县| 思南县| 溧阳市| 会同县| 凤台县| 高碑店市| 潞西市| 新安县| 淳化县| 玉龙|