# 더 나은 REST API를 설계하는 법

> Clean Markdown view of GeekNews topic #6121. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=6121](https://news.hada.io/topic?id=6121)
- GeekNews Markdown: [https://news.hada.io/topic/6121.md](https://news.hada.io/topic/6121.md)
- Type: news
- Author: [xguru](https://news.hada.io/@xguru)
- Published: 2022-03-11T09:38:47+09:00
- Updated: 2022-03-11T09:38:47+09:00
- Original source: [r.bluethl.net](https://r.bluethl.net/how-to-design-better-apis)
- Points: 26
- Comments: 2

## Topic Body

- 일관성 유지  : URL/헤더/인증/상태코드..  
- ISO8601 UTC 날짜 포맷 사용   
- Public Endpoint만 인증 예외. 나머지는 모두 인증 필수  
- 헬스 체크 Endpoint 제공   
- API 버저닝   
- API 키 인증 적용   
- 합리적인 HTTP 상태코드 와 메소드 사용   
- 각 Endpoint에 자체만으로 설명 가능한 간단한 이름을 사용   
- 표준 에러 응답 사용   
- POST에서 생성된 자원을 리턴   
- PUT 대신 PATCH   
- 최대한 구체적으로   
- Pagination 사용   
- 각 자원을 확장 가능하게 (expand 등의 쿼리 파람을 줘서 추가 정보도 리턴 가능하게 설계)

## Comments



### Comment 9235

- Author: eajrezz
- Created: 2022-03-14T23:21:04+09:00
- Points: 1

요새 관련 내용을 이곳저곳에서 많이 접했는데, "일상 속 사물이 알려주는 웹 API 디자인"을 추천해요. 제목과 표지 때문에 인터넷에 대한 쉬운 비유서 같은걸로 착각할 수 있는데, API 디자인을 업으로 삼고있는 저자님의 API 디자인에 대한 통찰력이 돋보이는 좋은 서적이에요.

### Comment 9215

- Author: xguru
- Created: 2022-03-13T11:51:06+09:00
- Points: 1

[Microsoft REST API 가이드라인](https://news.hada.io/topic?id=961)  
[Stackoverflow의 REST API 가이드 라인](https://news.hada.io/topic?id=1636)
