💻/Spring | SpringBoot

[Spring Boot 3.x 를 이용한 RESTful Web Services 개발] 섹션 6. RESTful API 설계 가이드

kimmeoww 2024. 4. 29. 16:52
728x90
반응형

Richardson Maturity Model

Maturity Model(성수도 모델)

  • Level 0
    • Expose soap web services in rest style
    • http://server/getPosts
    • http://server/deletePosts
    • http://server/doThis
  • Level 1
    • Expose resources with proper uri
    • http://server/accounts
    • http://server/accounts/10
    • note: improper use of http methods
  • Level 2
    • Level1 + HTTP Methods
  • Level 3
    • Level2 + HATEOAS
    • DATA + NEXT POSSIBLE ACTIONS

RESTful API 설계 시 고려해야 할 사항

  • Consumer first
  • Make best use of 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
    • prefer /users/1 to /user/1
  • User nouns for resources
  • For exceptions
    • defines a consistent approach
      • /search
      • PUT /gists/{id}/star
      • DELETE /gists/{id}/star

 

[개정판 2023-11-27] Spring Boot 3.x 를 이용한 RESTful Web Services 개발 | Dowon Lee - 인프런

Dowon Lee | 이 강의는 Spring Boot를 이용해서 RESTful Web Services 애플리케이션을 개발하는 과정에 대해 학습하는 강의으로써, REST API 설계에 필요한 기본 지식에 대해 학습할 수 있습니다., 스프링 부트

www.inflearn.com

 

728x90
반응형