사용예시)

특정 post를 삭제하려는 목적으로 axios로 delete 메서드를 호출하는 상황에서 axios에서 특정 post의 id를 넘겨주는데도 서버에서는 id값을 인식하지 못함

req.params

서버에서 req.params로 받을 수 있는 것은, 이미 예약된 값

// server
post.get("/:id/:username",() => {
 ... // 함수 내용
})
// client

await axios({
  method : "get",
  url : "www.domainnameexample.com/post/3/kim",
  params : {title : "hi"}
})

// or

await axios.get("www.domainnameexample.com/post/3/kim",{params : {
  title:"hi"
}})

⇒ 전송되는 url "www.domainnameexample.com/post/3/kim?title=hi"

console.log(req.params);
// {id : "1" , name : "kim"}

console.log(req.query);
// {title : "hi"}