티스토리 뷰

REST 방식으로 URI를 설계할때 기존 get, post 이외에 put, delete 메서드를 추가로 사용하게된다.

그런데 form 태그의 method 속성은 get과 post밖에 지원하지 않는다.

메서드를 put으로 지정했는데 get으로 날아가길래 왜 그런가 하다가 알게된 사실이다;;


<form name="question" method="post" action="/question/{{id}}">
<input type="hidden" name="_method" value="put"/>
</form>

이런식으로 input 태그를 이용해서 put, delete 메서드를 활용할 수 있다.

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함