DB Basic Operations
Create
- Successfully returns 201 + body { Record } + location header field + /{id} to locate it
- Already Exits returns 409 + body { statusCode: 409 , message: ‘Resource with ID xx already exists, couldn't create’ }
- General returns 500 + body { statusCode:500, message: ‘juggler original message’ }
Read
- Successfully returns 200 + body { Record }
- Not found returns 404 + body { statusCode: 404 , message: ‘Resource with ID xx not found’ }
- General returns 500 + body { statusCode:500, message: ‘juggler original message’ }
Update
- Successfully returns 200 + body { Record }
- Not found returns 404 + body { statusCode: 404 , message: ‘Resource with ID xx not found, couldn't update' }
- General returns 500 + body { statusCode:500, message: ‘juggler original message’ }
Delete
- Successfully returns 200 + body { Record }
- Not found returns 404 + body { statusCode: 404 , message: ‘Resource with ID xx not found, couldn’t delete' }
- General returns 500 + body { statusCode:500, message: ‘juggler original message’ }
Notes
1- { Record } is the full record, and behaves similar to the current insert operation in that it returns the defined record in the model.
2- statusCode is evaluated internally today and that’s the number placed in the http status header
3- 201 In the insert should also include A Location Header field with /newlycreatedID appended
网友评论