◆HTTP
Rest API란? + 설계 예시
쿠키린
2023. 5. 2. 09:18
[네트워크] REST API란? REST, RESTful이란?
REST API란 REST를 기반으로 만들어진 API를 의미합니다. REST API를 알기 위해 REST부터 알아보도록 하겠습니다. REST란? REST(Representational State Transfer)의 약자로 자원을 이름으로 구분하여 해당 자원의 상
khj93.tistory.com
REST API 설계 예시
1. URI는 동사보다는 명사를, 대문자보다는 소문자를 사용하여야 한다.
Bad Example http://khj93.com/Running/
Good Example http://khj93.com/run/
2. 마지막에 슬래시 (/)를 포함하지 않는다.
Bad Example http://khj93.com/test/
Good Example http://khj93.com/test
3. 언더바 대신 하이폰을 사용한다.
Bad Example http://khj93.com/test_blog
Good Example http://khj93.com/test-blog
4. 파일확장자는 URI에 포함하지 않는다.
Bad Example http://khj93.com/photo.jpg
Good Example http://khj93.com/photo
5. 행위를 포함하지 않는다.
Bad Example http://khj93.com/delete-post/1
Good Example http://khj93.com/post/1