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

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.
主站蜘蛛池模板: 宁陕县| 淳安县| 荔浦县| 嵩明县| 江油市| 仙居县| 岚皋县| 鄂尔多斯市| 桃园市| 株洲县| 和田市| 正镶白旗| 商都县| 芦溪县| 阿瓦提县| 保靖县| 南华县| 吉林省| 海阳市| 南郑县| 平顺县| 新疆| 景洪市| 台北县| 海兴县| 依安县| 嵊泗县| 嘉兴市| 方山县| 多伦县| 昭苏县| 彭水| 周至县| 凤冈县| 夏邑县| 宁化县| 宾川县| 偃师市| 尚志市| 莫力| 南阳市|