
client가 server에 요청을 함
데이터를 header와 body 에 담아서 보낸다.
1.url로 보내기
url 끝에 ?를 기준으로 뒤에 존재하는 값들
ex1)https://search.naver.com/search.naver?where=nexearch&sm=top_hty&fbm=1&ie=utf8&query=nodejs
ex2)https://search.naver.com/search.naver?where=nexearch&sm=top_sly.hst&fbm=1&acr=1&acq=javas&qdt=0&ie=utf8&query=javascript
여러개의 값을 보낼 때에는 &으로 구분
app.get("/query",(req,res)=>{
console.log("query:",req.query);
res.send('/요청했음');
})

app.get("/pathparam/:id",(req,res)=>{
console.log("params:",req.params);
res.send('/요청했음');
})

2.헤더로 보내기
app.get("/header",(req,res)=>{
console.log("headers:",req.headers);
res.send('/요청했음');
})

app.get("/cookie",(req,res)=>{
console.log("cookies:",req.cookies);
res.send('/요청했음');
});

3.바디로 보내기
app.get("/body",(req,res)=>{
console.log("body:",req.body,typeof(req.body));
res.send('/요청했음')
})
