OData 规范很长。甚至“ OData Core ”文档也很长。
那么,简要总结一下只读 OData 发布者至少需要实现什么?
我会开始的。OData 服务提供了一个 HTTP 端点,它:
Accept”标题GET /(10.1.1)
service/workspace/collection/titleGET /Customers必须将集合的描述返回给像(10.2)
这样的请求feed/entry/contentGET /Customers(3)必须将单个实体的描述返回给像(10.2.1)这样的请求GET /Customers(3)/Name可以为(10.2.2)之类的请求返回单个实体的单个属性/$metadataProducts?$filter=Price lt 10.00Products?$select=Rating,ReleaseDateProducts?$orderby=ReleaseDate asc, Rating descProducts?$top=5&$skip=2Products?$inlinecount=allpagesProducts(0)/$links/OrdersProducts/$count$format(10.2.3.7)当返回一个 ATOM 提要(例如一个集合)时,它需要符合一些 OData 约定:http ://www.odata.org/documentation/odata-v3-documentation/atom-format/例如:
edm:String”等。link元素被大量使用content元素要么包含内联内容(例如,文本数据),要么通过src=属性链接到它(例如,图像、二进制文件)。返回 JSON 提要时,它同样遵循某些规则:
鼓励 URL 遵循此方案: