a story

VS Code에서 REST 테스트 하기 본문

기타

VS Code에서 REST 테스트 하기

한명 2023. 11. 5. 22:58

Postman 으로 REST 테스트를 수행할 수 있지만 VS Code에서도 Rest Client를 통해 REST 테스트를 할 수 있다.

VS Code의 Extention에서 Rest Client 를 설치한다.

 

코드가 있는 위치에서 http.test 파일을 생성한다.

GET http://localhost:3000/students

###
POST http://localhost:3000/students
Content-Type: application/json

{
    "Id": 0,
    "Name":"ccc",
    "Age":15,
    "Score":75
}

 

VS Code 에서 'Send Request'를 누르면 요청이 전달되고, Response를 확인할 수 있다.