我想学习REST服务的技术属性。但是我应该问我的问题让我困惑。
例如,我创建了一个php或。net web api页面,它与JSON对象一起工作。
- http://myservice.com/products(得到)
- http://myservice.com/products/get/1(得到)
- http://myservice.com/products/create (POST)
- http://myservice.com/products/delete (POST)
这是休息服务吗?
并查看REST示例,该示例具有单个端点并获取所有HTTP方法。
- http://myservice.com/products(得到)
- http://myservice.com/products (POST)
- http://myservice.com/products (PUT)
- http://myservice.com/products(删除)
rest服务应该使用xml对象,而不是JSON对象。
整个主题相当广泛,我建议你看看这本关于REST和API区别的小书。
http://www.restapitutorial.com/media/RESTful_Best_Practices-v1_1.pdf