【发布时间】:2017-03-21 17:02:22
【问题描述】:
给出这个命名约定:
http://www.restapitutorial.com/lessons/restfulresourcenaming.html
对于 POST(插入),资源的 url 应遵循此路径/逻辑:
http://www.example.com/products/X123
{
"color":"something"
}
以下路径在概念上是错误的吗?为什么正确/错误?
http://www.example.com/products
{
"id":"X123"
"color":"something"
}
ID 是外部生成的
对于 PUT 也可以应用相同的逻辑吗? (id自然不能改,只能作为ref使用)
谢谢
【问题讨论】:
-
您能否说得更具体一点:客户端决定创建资源的 ID 是否正确?
标签: rest asp.net-web-api soa restful-architecture