728x90
728x90
장고에서 내가 만든 Rest API가 잘 작동하는 지 확인하고 싶다면?
=> 포스트맨으로 health check를 하자!
![[Postman] 포스트맨으로 Rest API 기능 검사 / health check ! [Postman] 포스트맨으로 Rest API 기능 검사 / health check !](http://t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png)
1. 분홍 박스
- 자신의 API가 GET인지, POST인지 등등 확인 후 좌측 버튼을 눌러 선택! (나는 GET)
- urls.py에서 설정해둔, 확인하고 싶은 url을 입력한다
![[Postman] 포스트맨으로 Rest API 기능 검사 / health check ! - undefined - undefined - 1. 분홍 박스 [Postman] 포스트맨으로 Rest API 기능 검사 / health check ! - undefined - undefined - 1. 분홍 박스](http://t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png)
<- 확인하고 싶은 API
![[Postman] 포스트맨으로 Rest API 기능 검사 / health check ! - undefined - undefined - 1. 분홍 박스 [Postman] 포스트맨으로 Rest API 기능 검사 / health check ! - undefined - undefined - 1. 분홍 박스](http://t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png)
<- API가 실행되는 url (urls.py)
2. 노랑 박스
Tests 를 선택하고 다음과 같은 코드를 넣은 뒤 Send 버튼을 누른다!
pm.test("Status test", function(){
pm.response.to.have.status(200);
})
3. 결과
![[Postman] 포스트맨으로 Rest API 기능 검사 / health check ! - undefined - 모든 영역 [Postman] 포스트맨으로 Rest API 기능 검사 / health check ! - undefined - 모든 영역](http://t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png)
성공!
![[Postman] 포스트맨으로 Rest API 기능 검사 / health check ! - undefined - 모든 영역 [Postman] 포스트맨으로 Rest API 기능 검사 / health check ! - undefined - 모든 영역](http://t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png)
실패 ㅜㅠ
728x90
728x90
댓글