반응형
Notice
Recent Posts
Recent Comments
Link
«   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
Tags
more
Archives
Today
Total
관리 메뉴

디케이

[html] form 작성 시 get과 post 차이점 본문

HTML, CSS

[html] form 작성 시 get과 post 차이점

디케이형 2021. 2. 28. 11:22
반응형

GET

<form action="http://locallhost:8021/usr/home/main" method="GET">
  <input type="hidden" name="age" value="11">
  <input type="submit" value="전송">
</form>

위와 같은 폼에서 전송으로 get처리 하면 아래와 같은 url생성
http://localhost:8021/usr/home/main?age=11

기본적인 HTTP Request(요청서)
--- Header ---
주소: http://localhost:8021/usr/home/main
쿼리 파라미터: age=11
--- Body ---

POST

<form action="http://locallhost:8021/usr/home/main" method="POST">
  <input type="hidden" name="age" value="11">
  <input type="submit" value="전송">
</form>

위와 같은 폼에서 전송으로 post처리 하면 아래와 같은 url생성
http://localhost:8021/usr/home/main?age=11

기본적인 HTTP Request(요청서)
--- Header ---
주소: http://localhost:8021/usr/home/main
쿼리 파라미터:
--- Body ---
age=11

정리

  • get은 부가정보 쿼리파라미터가 Header에 생성 post는 Body에 생성
반응형