서비스를 리뉴얼하는 중 외부 업체에 API를 제공해야 하는 것을 확인
Pure RESTful API를 위해 GET, POST 외에 PUT, PATCH, DELETE를 사용하려 했으나 PATCH 지원은 보편적이지 않고, PUT와 DELETE 사용도 불가능한 클라이언트가 다수 있음
시스템이 최소 5년 최대 25년 된 업체도 존재
https://injun-woo30000.gitbook.io/growth-log/i-learned/general/sdk-api
https://restfulapi.net/http-methods/
| HTTP Method | CRUD | Collection Resource (e.g. /users) | Single Resouce (e.g. /users/123) |
|---|---|---|---|
| POST | Create | 201 (Created), ‘Location’ header with link to /users/{id} containing new ID | Avoid using POST on a single resource |
| GET | Read | 200 (OK), list of users. Use pagination, sorting, and filtering to navigate big lists | 200 (OK), single user. 404 (Not Found), if ID not found or invalid |
| PUT | Update/Replace | 405 (Method not allowed), unless you want to update every resource in the entire collection of resource | 200 (OK) or 204 (No Content). Use 404 (Not Found), if ID is not found or invalid |
| PATCH | Partial Update/Modify | 405 (Method not allowed), unless you want to modify the collection itself | 200 (OK) or 204 (No Content). Use 404 (Not Found), if ID is not found or invalid |
| DELETE | Delete | 405 (Method not allowed), unless you want to delete the whole collection — use with caution | 200 (OK). 404 (Not Found), if ID not found or invalid |
안전한 메소드과 안전하지 않은 메소드로 구분하고 GET, POST만으로 API를 제공