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

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.
主站蜘蛛池模板: 岳阳市| 大悟县| 福泉市| 布拖县| 砀山县| 白河县| 苏尼特左旗| 北京市| 运城市| 杭州市| 北票市| 平和县| 潍坊市| 东明县| 兴山县| 淮阳县| 苏州市| 福州市| 万年县| 阿拉善右旗| 张家口市| 白城市| 民丰县| 富阳市| 健康| 牟定县| 丹棱县| 南平市| 澳门| 普陀区| 翼城县| 都兰县| 上杭县| 夹江县| 苍南县| 柘城县| 登封市| 曲水县| 尼勒克县| 荣成市| 申扎县|