Richardson Maturity Model
A way to grade your API according to the constraints of REST
Level 0
expose soap web services in rest style
Level 1
expose resources with proper url
note : improper use of http methods → ๋ชจ๋ ์์ฒญ์ GET, POST๋ก ๋ฐ๊ฑฐ๋ ์๋ฌ/200์ผ๋ก๋ง ๋ฐํํ๋ ํํ
Level 2
level1 + HTTP methods(GET, POST, PUT, DELETE ๊ตฌ๋ถ)
Level 3
level2 + HATEOAS
DATA + NEXT POSSIBLE ACTIONS ⇒ ์ต์ํ์ end point๋ง์ ๊ฐ์ง๊ณ ๋ค์ url์ ์ ์ ์๊ฒ ํจ
์ค๊ณ ์ ๊ณ ๋ ค ์ฌํญ
- consumer first : ๊ฐ๋ฐ์ ์ค์ฌ์ ์ค๊ณ ๋ณด๋ค๋ ์๋น์ ์ ์ฅ์์ ๊ฐ๋จ๋ช ๋ฃํ๊ณ ์ง๊ด์ ์ธ API ์ค๊ณ
- make best use of HTTP : HTTP ์ฅ์ ์ด๋ฆฌ๊ธฐ
- Request methods
- GET
- POST
- PUT
- DELETE
- Response Status
- 200
- 404
- 400
- 201
- 401
- No secure info in URI
- use plurals
prefer users to user
- use nouns for resources
- for exceptions
define a consistent approach
url์ ๋จ์ํ๊ฒ, parameter/header/HTTP ์ํ์ฝ๋๋ฅผ ๋ค์ํ๊ฒ
PUT /gists/{id}/star
DELETE /gists/{id}/star
'๐ฟ Spring > โ RESTful Web Service' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
5. Java Persistence API ์ฌ์ฉ (0) | 2023.06.20 |
---|---|
4. Spring Boot API ์ฌ์ฉ (0) | 2023.06.20 |
3. RESTful Service ๊ธฐ๋ฅ ํ์ฅ (0) | 2023.06.20 |
2. User Service API ๊ตฌํ (0) | 2023.06.20 |
1. Spring Boot๋ก ๊ฐ๋ฐํ๋ RESTful Service (0) | 2023.06.20 |
๋๊ธ