简体   繁体   English

宁静的API设计文档

[英]Restful API Design Document

As a part of my homework, i have to do this: 作为作业的一部分,我必须这样做:

You need to send us a design document on how you would implement a restfull API for an online store. 您需要向我们发送一份设计文档,说明如何为在线商店实现Restfull API。 It should support addition, deletion, editing and searching a product. 它应该支持添加,删除,编辑和搜索产品。 You are free to assume every thing else but make sure you document them. 您可以随意承担其他所有事项,但请确保将它们记录下来。 Make sure you have considered things like authentication (only authenticated users can add / view / edit / delete items). 确保您已考虑过身份验证之类的事情(只有经过身份验证的用户才能添加/查看/编辑/删除项目)。 You are creating the API for a mobile developer who will use it to create a mobile app. 您正在为将要使用它来创建移动应用程序的移动开发人员创建API。 Would be great if you can also include some example scenarios along with the expected request / response objects. 如果您还可以包括一些示例方案以及预期的请求/响应对象,那就太好了。

I was unfamiliar about restful api's but have now read about them and understand all the basic fundamentals well. 我不熟悉宁静的api,但现在已经阅读了有关api并很好地理解了所有基本原理。 I am just unsure of what am i required to do in the above problem? 我只是不确定在上述问题上我需要做什么?

Do i have to provide code for the API like on this web page, http://coreymaynard.com/blog/creating-a-restful-api-with-php/ 我是否必须像此网页http://coreymaynard.com/blog/creating-a-restful-api-with-php/一样提供API的代码

or i dont have to code but i have to explain the implementation of the code in English? 还是我不必编写代码,但我必须用英语解释代码的实现?

or do i just have to state the resources, their representations, the different types of actions on the different types of uri's and the corresponding responses. 还是我只需要声明资源,它们的表示形式,对不同类型的uri的不同类型的操作以及相应的响应。

I understand REST but i am just unsure of what this question has asked me to do? 我了解REST,但是我不确定这个问题要我做什么?

What exactly is a design document, for a RESTFUL API. 什么是RESTFUL API的设计文档。

when in business, design doc usually means you're planning the technical process / structure of a feature, and you explain the benefits and possible pitfalls, etc. its really hard to tell whether or not your teacher actually is talking about API design in that regard. 在业务中,设计文档通常意味着您正在计划功能的技术流程/结构,并说明其好处和可能的陷阱等。要确定您的老师是否实际上在谈论API设计真的很难。看待。 mostly, he's probably wanting you to list all of the API urls and explain which method is for each, and what their functions are. 大多数情况下,他可能希望您列出所有API网址,并解释每个网址的方法以及它们的功能。

chances are, if he means RESTful api design in the latter meaning, then its probably similar to how Rails displays their routes: 如果他的意思是RESTful api设计,那么它很有可能类似于Rails显示其路线的方式:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM