21. #cmdevio2018
PUT /depts/acct
{
"dept_code": "acct",
"name": "Accounting"
}
200 OK or 201 Created
( )
POST /depts
{
"dept_code": "acct",
"name": "Accounting"
}
200 OK or 409 Conflict
( )
PUT
Dept
POST
Dept
CreateDeptRequest
echo "{...}" >/depts/acct execute create_dept({...});
22. #cmdevio2018
GET /depts/sales/emps
200 OK
GET /depts/research
DELETE /depts/research
GET /depts/research/emps
etc...
404 Not Found
POST /depts
{
"dept_code": "research",
"name": "Research"
}
200 OK
POST /depts
{ "dept_code": "research" }
400 Bad Request
404 400
26. #cmdevio2018
GET /depts
POST /depts
GET /depts/{dept_code}
POST /depts/{dept_code}
PATCH /depts/{dept_code}
PUT /depts/{dept_code}
DELETE /depts/{dept_code}