REST API

단단한어린이·2022년 4월 5일
0

HTTP/Network

목록 보기
1/2
post-thumbnail

REST(Representational State Transfer) was first devised by Roy Fielding. REST was introduced as an architecture that can make the most of the advantages of the web, which induces the HTTP protocol to be designed according to its intention. The service design that faithfully adheres to the basic principles of REST is expressed as "RESTful".


REST API core rule

1. URI should express the resources of information.

  • Resource names use nouns rather than verbs.
  • URI should focus on expressing resources.
  • There should be no expression for an act like 'GET'.

2. Actions on resources are expressed as HTTP Methods.


HTTP Methods

  • GET => index / retrieve   ||   payload X
  • POST => create   ||   payload O
  • PUT => replace (modify all of the resources)   ||   payload O
  • PATCH => modify (modify some of the resources)   ||   payload O
  • DELETE => delete   ||   payload X

REST API elements

The REST API consists of three elements. Resource, Verb and Representations. REST is composed of a self-descriptivity structure, so the request can be understood only with the REST API.

  • Resource - HTTP URI
  • Verb - HTTP Method
  • Represntations - HTTP Message Pay Load
profile
Footprints in Coding

0개의 댓글