HTTP method for CRUD operation
POST = Create
GET = Read
PUT = Update
DELETE = Delete
Request Line :
HTTP method 정보가 들어있다.
GET, POST, PUT, DELETE 등등
Header Variables :
request metadata 가 들어있다.
Message body :
message 의 내용이 있음.
Response line :
서버 프로토콜과 상태 정보가 있다.
나머지는 request message와 같다.
메시지 포맷은 MIME으로 묘사된다.
Multipurpose Internet Mail Extension
Basic Syntax : type/sub-type
EX : text/html, text/plain, application/json, application/xml
Client Tool 이 필요하다.
HTTP requests를 REST Web Service /API에 보내는 프로그램이 필요하다.
여러 개가 있는데 Postman이 있다.
Postman | The Collaboration Platform for API Development
Postman makes API development easy. Our platform offers the tools to simplify each step of the API building process and streamlines collaboration so you can create better APIs faster.
www.postman.com
포스트맨이라고 api 개발을 편하게 해주는 툴
JSON Test by jsontest
JSONTest.com is a testing platform for services utilizing JavaScript Object Notation (JSON). To use, make a request to servicename.jsontest.com, where servicename is the name of a service listed below. We also support a number of parameters, such as callba
www.jsontest.com
이 페이지에서 endpoint 주소를 포스트맨에 넣어 실험할 수 있다.
JSONPlaceholder - Free Fake REST API (typicode.com)
JSONPlaceholder - Free Fake REST API
{JSON} Placeholder Free fake API for testing and prototyping. Powered by JSON Server + LowDB As of Dec 2020, serving ~1.8 billion requests each month.
jsonplaceholder.typicode.com
한 번 테스트해보자 위 사이트에 들어가면
아래에 /user 하이퍼링크를 타고 들어가자.
대충 이런 내용이 있는데 이 페이지의 링크를 복사하고
포스트맨 워크스페이스에서 get으로 링크에 요청을 하면
메시지를 볼 수 있다...
위에서 본 어글리하게 보는 게 아니라 깔쌈하게 표현되어있어서 개발할 때 아주 편할 것이다..
헤더에 메타데이터가 있는데
Content-Type 에 application/json 이라고
방금 우리가 다룬 MIME 정보가 있다.
'컴퓨터공학 > Spring & Hibernate' 카테고리의 다른 글
Spring> Spring REST> POJOs를 JSON으로... (0) | 2021.09.04 |
---|---|
Spring> Spring REST> Spring REST Controller (0) | 2021.09.04 |
Spring> Spring REST> JSON Data Binding (0) | 2021.05.30 |
Spring> Security> Password Encryption (0) | 2021.05.30 |
Spring> Security> JDBC Database Authentication (0) | 2021.05.30 |