如何使用HATEOAS从对象集合中删除资源?
PUT将设置集合。补丁将允许部分更新/添加。
但是我怎么做部分更新/删除呢?
我真的需要发布整个uri-list减去1才能删除单个项目吗?
以此对象为例:
{
"name": "Bob Test",
"description": "this is the descript",
"_links": {
"self": {
"href": "http://localhost/example/1"
},
"example": {
"href": "http://localhost/example/1"
},
"citations": {
"href": "http://localhost/example/1/citations"
},
}
}该对象有许多引用(集合):
{
"_embedded": {
"citations": [
{
"content": "asdfasdf",
"anchor": null,
"_links": {
"self": {
"href": "http://localhost/citations/1"
},
"citation": {
"href": "http://localhost/citations/1"
},
"bioMarker": {
"href": "http://localhost/citations/1/example"
}
}
},
{
"content": "c2",
"anchor": "prf",
"_links": {
"self": {
"href": "http://localhost/citations/2"
},
"citation": {
"href": "http://localhost/citations/2"
},
"bioMarker": {
"href": "http://localhost/citations/2/example"
}
}
}
]
},
"_links": {
"self": {
"href": "http://localhost/example/1/citations"
}
}
}现在假设我想要删除http://localhost/citations/2,如何从http://localhost/example/1/citations集合中删除此特定项?
发布于 2019-01-07 13:55:06
从响应中获取内容类型,并在请求头部"Accept“中发送。通常是"application/xxxxx+json“
https://stackoverflow.com/questions/36069584
复制相似问题