res.send() vs res.json()

김남경·2022년 12월 12일

server

목록 보기
5/7

res.send()

Content-type을 자동으로 지정해줌
Buffer,String, Object, Array 등이 있음

res.json()

Content-type을 application/JSON으로 고정
RESTful API형태로 데이터를 주고 받는 경우가 많으므로 유용

Express res.send() vs res.json() vs res.end() 비교

profile
기본에 충실하며 앞으로 발전하는

0개의 댓글