基于 RESTful 风格构建 WebApi。
| Http 方法 | Uri | Request Body | 说明 |
|---|---|---|---|
| GET | /posts | 获得对象列表 | |
| GET | /posts/1 | 获得指定对象 | |
| POST | /posts/ | Body: { Name: 'New post!', Body: 'Some stuff..' } | 创建一个新对象 |
| PUT | /posts/1 | Body: { Name: 'some post!', Body: 'Some stuff..' } | 更新指定对象 |
| DELETE | /posts/1 | 删除指定对象 |
| Http 方法 | Uri | Request Body | 说明 |
|---|---|---|---|
| POST | /posts/bantch | Body: [{ Name: 'New post1', Body: 'Some stuff..' }, { Name: 'New post2', Body: 'Some stuff..' }] | 批量创建对象 |
| PUT | /posts/bantch | Body: { Ids: [1,2,3,66,73,202], Model: { Name: 'New post2', Body: 'Some stuff..' }} | 批量更新对象 |
| DELETE | /posts/bantch | Body: [1, 2, 3, 4, 5, 10, 42, 68, 99] | 批量删除对象 |