Bibi's DevLog ๐Ÿค“๐ŸŽ

mustache(ํ…œํ”Œ๋ฆฟ์—”์ง„), ๋™์ HTML, MVC์˜ ๊ฐœ๋…, formํƒœ๊ทธ, GET/POST ์ฐจ์ด ๋ณธ๋ฌธ

๐Ÿ–ฅ BE ๋ฐฑ์—”๋“œ/Spring ์Šคํ”„๋ง

mustache(ํ…œํ”Œ๋ฆฟ์—”์ง„), ๋™์ HTML, MVC์˜ ๊ฐœ๋…, formํƒœ๊ทธ, GET/POST ์ฐจ์ด

๋น„๋น„ bibi 2021. 3. 9. 01:05

mustache๋ฅผ ํ™œ์šฉํ•œ ๋™์ ์ธ HTML๊ณผ MVC ์„ค๋ช…

์ปจํŠธ๋กค๋Ÿฌ์—์„œ mustache๋ผ๋Š” ํ…œํ”Œ๋ฆฟ์—”์ง„์— ๋ฐ์ดํ„ฐ๋ฅผ ์ „๋‹ฌํ•ด, ๋™์ ์ธ HTML์„ ๋งŒ๋“ค์–ด๋‚ด๋Š” ๋ฒ•์„ ๋ฐฐ์šด๋‹ค.

MVC์˜ ๊ฐœ๋…

MVC๋Š” ํ•œ ๊ณณ์—์„œ ๋งŽ์€ ๋กœ์ง์„ ์ฒ˜๋ฆฌํ•˜๋Š” ๋Œ€์‹ , ๊ฐ ์ฝ”๋“œ์˜ ์—ญํ• ์„ ๋ถ„๋‹ดํ•˜๊ธฐ ์œ„ํ•ด ๋“ฑ์žฅํ–ˆ๋‹ค.

  • Controller : ์ตœ์ดˆ ์ง„์ž… ์ง€์ . ์‚ฌ์šฉ์ž์˜ ์ž…๋ ฅ ๊ฐ’์ด ์œ ํšจํ•œ ์ง€๋ฅผ ๊ฒ€์ฆํ•˜๊ณ , ์‚ฌ์šฉ์ž๊ฐ€ ์ž…๋ ฅํ•œ ๋ฐ์ดํ„ฐ๋ฅผ Model์— ์ „๋‹ฌํ•˜๊ณ , Model์˜ ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ์— ๋”ฐ๋ผ ์ด๋™ํ•  View๋ฅผ ๊ฒฐ์ •ํ•˜๋Š” ์—ญํ• 
  • Model : ์‹ค์งˆ์ ์ธ ๋น„์ฆˆ๋‹ˆ์Šค ๋กœ์ง์„ ๊ตฌํ˜„ํ•˜๋Š” ์—ญํ• ์„ ๋‹ด๋‹นํ•จ. ๋น„์ฆˆ๋‹ˆ์Šค ๋กœ์ง ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ๋ฅผ DB์— ์ €์žฅํ•˜๊ณ  ์กฐํšŒํ•˜๋Š” ์—ญํ• . ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ ์—”์ง„์ด๋ผ ํ•  ์ˆ˜ ์žˆ์Œ.
  • View : Controller์— ์˜ํ•ด ์ „๋‹ฌ๋œ ๋ฐ์ดํ„ฐ๋ฅผ ๋‹จ์ˆœํžˆ ์ถœ๋ ฅํ•˜๋Š” ์—ญํ• 

ํ…œํ”Œ๋ฆฟ ์—”์ง„์ด๋ž€?

: ์ง€์ •๋œ ํ…œํ”Œ๋ฆฟ ์–‘์‹๊ณผ ๋ฐ์ดํ„ฐ๋ฅผ ์ด์šฉํ•˜์—ฌ HTML๋ฌธ์„œ๋ฅผ ์ถœ๋ ฅํ•˜๋Š” ์†Œํ”„ํŠธ์›จ์–ด.

  • ์„œ๋ฒ„ ํ…œํ”Œ๋ฆฟ์—”์ง„ : JSP, Freemarker ..
    • ์„œ๋ฒ„์—์„œ Java์ฝ”๋“œ๋กœ ๋ฌธ์ž์—ด์„ ๋งŒ๋“  ๋’ค, ๋ฌธ์ž์—ด์„ HTML๋กœ ๋ณ€ํ™˜ํ•ด ๋ธŒ๋ผ์šฐ์ €๋กœ ์ „๋‹ฌํ•จ
  • ํด๋ผ์ด์–ธํŠธ ํ…œํ”Œ๋ฆฟ์—”์ง„ : ViewํŒŒ์ผ(๋ฆฌ์•กํŠธ ๋“ฑ)

์ž๋ฐ”์—์„œ๋Š” ๋‹ค์–‘ํ•œ ์„œ๋ฒ„ ํ…œํ”Œ๋ฆฟ ์—”์ง„์ด ์กด์žฌํ•จ.

  • JSP, Velocity, Freemarker, Thymeleaf, Mustache .. ๊ฐ€ ์žˆ์Œ
    • ๊ถŒ์žฅ : Mustache, Thymeleaf
    • Mustache(๋ฌธ๋ฒ•์ด ์‹ฌํ”Œ. JS์™€ Java ๋ชจ๋‘ ์ง€์›. ์ธํ…”๋ฆฌ์ œ์ด ๋ฌด๋ฃŒ๋ฒ„์ „์—์„œ๋„ ํ”Œ๋Ÿฌ๊ทธ์ธ ์ง€์›)
    • Thymeleaf(์Šคํ”„๋ง์ด ์ ๊ทน ์ง€์› but ๋ฌธ๋ฒ•์ด ์–ด๋ ค์›€. JSํ”„๋ ˆ์ž„์›Œํฌ์™€ ๋น„์Šท)

mustache(๋จธ์Šคํƒœ์‹œ)

: ์ˆ˜๋งŽ์€ ์–ธ์–ด๋ฅผ ์ง€์›ํ•˜๋Š” ๊ฐ€์žฅ ์‹ฌํ”Œํ•œ ํ…œํ”Œ๋ฆฟ์—”์ง„.

์ž๋ฐ”์—์„œ ์‚ฌ์šฉ๋  ๋•Œ๋Š” ์„œ๋ฒ„ ํ…œํ”Œ๋ฆฟ ์—”์ง„์œผ๋กœ ์‚ฌ์šฉ ๊ฐ€๋Šฅ.

  • Mustache ํ…œํ”Œ๋ฆฟ ํŒŒ์ผ์„ ํ˜ธ์ถœํ•˜๋ ค๋ฉด ๋ฐ˜๋“œ์‹œ ์ปจํŠธ๋กค๋Ÿฌ๋ฅผ ํ†ตํ•ด ํ˜ธ์ถœํ•ด์•ผ ํ•œ๋‹ค.

  • ๋จธ์Šคํƒœ์‹œ์˜ ํŒŒ์ผ ์œ„์น˜๋Š” ๊ธฐ๋ณธ์ ์œผ๋กœ scr/main/resources/templates์ด๋‹ค.

  • ๋จธ์Šคํƒœ์‹œ์˜ ํŒŒ์ผ ํ™•์žฅ์ž๋Š” .mustache์ด๋‹ค. (.htmlํŒŒ์ผ ํ™•์žฅ์ž๋ฅผ .mustache๋กœ ์ƒ์„ฑํ•˜๋ฉด ๋œ๋‹ค)

์„ค์น˜

  1. ์ธํ…”๋ฆฌ์ œ์ด ํ”Œ๋Ÿฌ๊ทธ์ธ - mustache ๊ฒ€์ƒ‰ - "Handlebars/Mustache" ์„ค์น˜ ํ›„ ์žฌ์‹œ์ž‘

  2. build.gradle์— mustache ์˜์กด์„ฑ ๋“ฑ๋ก (dependencies์— ์ถ”๊ฐ€) ํ›„ gradle ์—…๋ฐ์ดํŠธ

    compile('org.springframework.boot:spring-boot-starter-mustache')

  3. application.properties์— ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์„ค์ •ํ•œ๋‹ค.

    (html ์ฝ”๋“œ ์ˆ˜์ •์‹œ ๋งค๋ฒˆ ์„œ๋ฒ„๋ฅผ ์žฌ์‹œ์ž‘ํ•˜๋Š” ๋ฒˆ๊ฑฐ๋กœ์›€์„ ํ”ผํ•˜๊ธฐ ์œ„ํ•œ ์ž‘์—…์ด๋‹ค)

    spring.mustache.cache=false

์ •์ ์ธ ํŽ˜์ด์ง€

package com.codessquad.qna.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class WelcomeController {

    @GetMapping("/helloworld")
    public String welcome() {
        return "welcome";
    }
}

@Controller : ์ปจํŠธ๋กค๋Ÿฌ์ž„์„ ๋ช…์‹œํ•˜๋Š” ์–ด๋…ธํ…Œ์ด์…˜

  • ๋ฉ”์„œ๋“œ๋ช…์€ ์•„๋ฌด ์ƒ๊ด€์ด ์—†๋‹ค.

  • @GetMapping("URL์ฃผ์†Œ")

    : ํ•ด๋‹น ๋ฉ”์„œ๋“œ๊ฐ€ ํ˜ธ์ถœ๋  URL์„ ์ง€์ •ํ•จ.

    @GetMapping(""), @PostMapping("") ๋‘ ๊ฐ€์ง€๋ฅผ ๋จผ์ € ์‚ฌ์šฉํ•ด ๋ณธ๋‹ค.

returl "welcome";

  • ๋จธ์Šคํƒœ์‹œ ์Šคํƒ€ํ„ฐ๊ฐ€ ์ปจํŠธ๋กค๋Ÿฌ์˜ ๋ฆฌํ„ด๊ฐ’(๋ฌธ์ž์—ด)์— ๋Œ€ํ•ด ์•ž์˜ ๊ฒฝ๋กœ(src/main/resources/templates)์™€ ๋’ค์˜ ํŒŒ์ผ ํ™•์žฅ์ž(.mustache)๋ฅผ ์ž๋™ ์ง€์ •ํ•ด ์ค€๋‹ค.

ํŒŒ์ผ์„ ๋ถˆ๋Ÿฌ์˜ค๋Š” ๊ณผ์ •

  1. ๋ธŒ๋ผ์šฐ์ €์—์„œ localhost:8080/helloworld๋กœ ์š”์ฒญ์„ ํ•˜๋ฉฐ ๋ฐ์ดํ„ฐ๋ฅผ ๋ณด๋‚ธ๋‹ค.
  2. ์ปจํŠธ๋กค๋Ÿฌ์—์„œ /helloworld๊ฐ€ ๋งตํ•‘๋œ welcome()๋ฉ”์„œ๋“œ๊ฐ€ ํ˜ธ์ถœ๋œ๋‹ค
  3. welcome()์˜ ๋ฆฌํ„ด๊ฐ’์ธ "welcome"์— ํ•ด๋‹นํ•˜๋Š” template๋””๋ ‰ํ† ๋ฆฌ์˜ htmlํŒŒ์ผ(mustache)์ธ welcome.mustache๊ฐ€ ๋กœ๋“œ๋œ๋‹ค

๋™์ ์ธ ํŽ˜์ด์ง€

์„œ๋ฒ„์— ๋™์ ์ธ ์š”์ฒญ ๋ณด๋‚ด๊ธฐ

: ์š”์ฒญ URL ๋’ค์— ?์„ ๋ถ™์ธ ๋‹ค์Œ, ํ‚ค=๊ฐ’(๋ณ€์ˆ˜๋ช…=๋ณ€์ˆ˜์˜ ๊ฐ’) ์„ ์ง€์ •ํ•œ๋‹ค.

localhost:8080/helloworld?name=bibi

๋‘ ๊ฐœ ์ด์ƒ์˜ ๊ฐ’์„ ๋ณด๋‚ผ ๋•Œ๋Š” ํ‚ค=๊ฐ’ ์‚ฌ์ด์— &๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค.

localhost:8080/helloworld?name=bibi&age=30

์„œ๋ฒ„์—์„œ ๋ฐ์ดํ„ฐ ๋ฐ›๊ธฐ

: URL์— ์ง€์ •๋œ ๋ณ€์ˆ˜๋ช…์„ ๋งตํ•‘๋œ ๋ฉ”์„œ๋“œ์˜ ํŒŒ๋ผ๋ฏธํ„ฐ๋กœ ๋ฐ›๋Š”๋‹ค.

  • ์˜ˆ๋ฅผ ๋“ค์–ดlocalhost:8080/helloworld?name=bibi ์˜ name=bibi๋ฅผ ๋ฐ›๊ธฐ ์œ„ํ•ด์„œ๋Š”

    @GetMapping("/helloworld")๋ฉ”์„œ๋“œ์˜ ํŒŒ๋ผ๋ฏธํ„ฐ๋ฅผ welcome(String name) ๋กœ ๋ฐ›์„ ์ˆ˜ ์žˆ๋‹ค.

  • ๋ฐ›์€ ๋ฐ์ดํ„ฐ๋ฅผ ํ™œ์šฉํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” MVCํŒจํ„ด ์ค‘ Model์„ ์‚ฌ์šฉํ•œ๋‹ค.

WelcomeController.java

package com.codessquad.qna;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class WelcomeController {

    @GetMapping("/helloworld")
    public String welcome(String name, Model model) {
        System.out.println("name : " + name);
        model.addAttribute("name", name);
        return "welcome";
    }
}

Model : ์ž„ํฌํŠธํ•ด์„œ ์‚ฌ์šฉ (import org.springframework.ui.Model;)

  • ๋ฉ”์„œ๋“œ์˜ ํŒŒ๋ผ๋ฏธํ„ฐ๋กœ Model์„ ์ง€์ •ํ•˜๊ณ ,
  • addAttribute(ํ‚ค, ๊ฐ’)๋กœ Model์— ํŒŒ๋ผ๋ฏธํ„ฐ๋กœ ๋ฐ›์€ ๊ฐ’์„ ๋„ฃ์–ด ์ „๋‹ฌํ•  ์ˆ˜ ์žˆ์Œ.
  • Model์— ์ €์žฅ๋œ ๋ฐ์ดํ„ฐ๋Š” "welcome"์ด ๋ฆฌํ„ด๋  ๋•Œ ํ•จ๊ป˜ ์ „๋‹ฌ๋œ๋‹ค.

์ฆ‰ ํ•ด๋‹น ๊ณผ์ •์€ MVC๋กœ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์„ค๋ช…ํ•  ์ˆ˜ ์žˆ๋‹ค.

: Controller์—์„œ Model์— ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅ ํ›„, welcome.html์ด๋ผ๋Š” View๋กœ ๋ณด๋‚ด๋Š” ๊ฒƒ.

welcome.mustache

<!DOCTYPE HTML>
<html>
<head>
    <title>Welcome</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<h1>์Šคํ”„๋ง ๋ถ€ํŠธ๋กœ ์‹œ์ž‘ํ•˜๋Š” ์›น ์„œ๋น„์Šค</h1>
{{name}}, hello world!
</body>
</html>

{{name}}

  • {{,}} : ๋จธ์Šคํƒœ์‹œ์˜ ๋ฌธ๋ฒ•์œผ๋กœ, Model์— ๋‹ด์€ ๋ฐ์ดํ„ฐ๋ฅผ ๊บผ๋‚ผ ๋•Œ ์‚ฌ์šฉํ•œ๋‹ค.

  • name : Model์— ๊ฐ’์„ ๋‹ด์„ ๋•Œ(addAttribute(ํ‚ค, ๊ฐ’)) ์‚ฌ์šฉํ•œ ํ‚ค๋ฅผ ๋“ฑ๋กํ•˜๋ฉด ๊ทธ ๊ฐ’์„ ๊ฐ€์ ธ์™€ ์ค€๋‹ค.

    ์ฆ‰ ์›น ํŽ˜์ด์ง€์ƒ ๊ฒฐ๊ณผ๋Š” bibi, hello world! ๊ฐ€ ๋œ๋‹ค.

์›น ๊ฐœ๋ฐœ์— html์„ ํ™œ์šฉํ•  ๋•Œ๋Š” ๊ฑฐ์˜ ๋™์ ์œผ๋กœ ์‚ฌ์šฉํ•œ๋‹ค.

์ฆ‰ ์‚ฌ์šฉ์ž๊ฐ€ ์ž…๋ ฅํ•œ ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€๊ณต ๋ฐ ์ฒ˜๋ฆฌํ•˜๊ณ , ๊ฐ’์— ๋”ฐ๋ผ html์„ ๋™์ ์œผ๋กœ ๋ฐ˜ํ™˜ํ•ด ๋ณด์—ฌ์ฃผ๊ฒŒ ๋œ๋‹ค.

๊ทธ ๋•Œ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ด ํ…œํ”Œ๋ฆฟ์—”์ง„์ด๋ฉฐ, ํ…œํ”Œ๋ฆฟ์—”์ง„ ์ค‘ ํ•˜๋‚˜๊ฐ€ mustache์ด๋‹ค.


<form>

์„œ๋ฒ„๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ์ „๋‹ฌํ•  ๋•Œ <form>ํƒœ๊ทธ๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค.

  • ์†์„ฑ action : ์„œ๋ฒ„์— ์š”์ฒญ์„ ๋ณด๋‚ผ ๋•Œ ์–ด๋–ค URL๋กœ ๋ณด๋‚ผ์ง€๋ฅผ ์ง€์ •ํ•  ์ˆ˜ ์žˆ์Œ.

    <form action="/create"> : ํ•ด๋‹น form์œผ๋กœ๋ถ€ํ„ฐ /create๋กœ ์„œ๋ฒ„์— ์š”์ฒญ์„ ๋ณด๋ƒ„

URL์ด ์ถ”๊ฐ€๋˜๋ฉด ํ•ญ์ƒ ์ƒ์‘ํ•˜๋Š” Controller ๋ฐ ๋ฉ”์„œ๋“œ๊ฐ€ ์žˆ์–ด์•ผ ํ•œ๋‹ค.

  • formํƒœ๊ทธ์— ์•„๋ฌด ์†์„ฑ์„ ์ž…๋ ฅํ•˜์ง€ ์•Š์œผ๋ฉด ๊ธฐ๋ณธ์ ์œผ๋กœ GET๋ฐฉ์‹์œผ๋กœ ํ†ต์‹ ํ•œ๋‹ค.

index.mustache

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Index</title>
</head>
<body>
<form action="/create">
    <div>
        <label for="userid">์•„์ด๋””</label>
        <input type="text" name="userid" placeholder="์•„์ด๋””">
    </div>
    <div>
        <label for="password">๋น„๋ฐ€๋ฒˆํ˜ธ</label>
        <input type="password" name="password" placeholder="๋น„๋ฐ€๋ฒˆํ˜ธ">
    </div>
    <div>
        <label for="username">์ด๋ฆ„</label>
        <input type="text" name="username" placeholder="์ด๋ฆ„">
    </div>
    <div>
        <label for="useremail">์ด๋ฉ”์ผ</label>
        <input type="email" name="useremail" placeholder="์ด๋ฉ”์ผ">
    </div>
    <button type="submit">์ œ์ถœ</button>
</form>
</body>
</html>

์•„๋ฌด๊ฒƒ๋„ ์ž…๋ ฅํ•˜์ง€ ์•Š๊ณ  ์ œ์ถœํ–ˆ์„ ๋•Œ์˜ URL

: http://localhost:8080/create?userid=&password=&username=&useremail=

UserController.java

package com.codessquad.qna.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class UserController {

    @GetMapping("/create")
    public String create(String userid, String password, String username, String useremail) {
        System.out.println("์•„์ด๋”” : " + userid);
        System.out.println("๋น„๋ฐ€๋ฒˆํ˜ธ : " + password);
        System.out.println("์ด๋ฆ„ : " + username);
        System.out.println("์ด๋ฉ”์ผ : " + useremail);
        return "index";
    }
}

์ถœ๋ ฅ ๊ฒฐ๊ณผ : ์•„์ด๋”” : a ๋น„๋ฐ€๋ฒˆํ˜ธ : b ์ด๋ฆ„ : c ์ด๋ฉ”์ผ : d@e

์ฆ‰, html์—์„œ name์— ํ•ด๋‹นํ–ˆ๋˜ ๊ฐ’๋“ค (userid, password, username, useremail)์„ ํŒŒ๋ผ๋ฏธํ„ฐ๋กœ ๋ฐ›์•„์™€ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค.

  • ๋‹จ์  : GET๋ฐฉ์‹์€ URL๋กœ ๊ฐ’์ด ์ „๋‹ฌ๋˜์–ด ๋น„๋ฐ€๋ฒˆํ˜ธ ๋“ฑ ๋…ธ์ถœ์œ„ํ—˜์ด ์žˆ๋‹ค. ์ด๋Ÿด ๋•Œ๋Š”

  • ํ•ด๊ฒฐ : formํƒœ๊ทธ์— method="post"์†์„ฑ์„ ์ถ”๊ฐ€ํ•˜๊ณ , ์ปจํŠธ๋กค๋Ÿฌ ์–ด๋…ธํ…Œ์ด์…˜์„ @PostMapping()์œผ๋กœ ๋ณ€๊ฒฝํ•ด POST๋ฐฉ์‹์œผ๋กœ ์ „๋‹ฌํ•˜๋ฉด ๋œ๋‹ค.

    POST๋ฐฉ์‹์€ ๋ฐ์ดํ„ฐ๋ฅผ URL๋กœ ์ „๋‹ฌํ•˜์ง€ ์•Š์•„ ์ •๋ณด๊ฐ€ ๋…ธ์ถœ๋˜์ง€ ์•Š๋Š”๋‹ค.

GET๋ฐฉ์‹๊ณผ POST๋ฐฉ์‹

GET ๋ฐฉ์‹ : ๋ฐ์ดํ„ฐ ์š”์ฒญ ๋ฐ ์กฐํšŒํ•  ๋•Œ.

POST ๋ฐฉ์‹ : ์„œ๋ฒ„์— ๋ฐ์ดํ„ฐ๋ฅผ ์ „์†กํ•ด ์ถ”๊ฐ€ ๋ฐ ์ˆ˜์ •ํ•  ๋•Œ.

GET, POST ์‚ฌ์šฉํ•˜๋Š” ๊ธฐ์ค€์€?

  • GET์€ Select์ ์ธ ์„ฑํ–ฅ์„ ๊ฐ€์ง€๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. GET์€ ์„œ๋ฒ„์—์„œ ์–ด๋–ค ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์™€์„œ ๋ณด์—ฌ์ค€๋‹ค๊ฑฐ๋‚˜ ํ•˜๋Š” ์šฉ๋„์ด์ง€ ์„œ๋ฒ„์˜ ๊ฐ’์ด๋‚˜ ์ƒํƒœ๋“ฑ์„ ๋ฐ”๊พธ์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๊ฒŒ์‹œํŒ์˜ ๋ฆฌ์ŠคํŠธ๋ผ๋˜์ง€ ๊ธ€๋ณด๊ธฐ ๊ธฐ๋Šฅ ๊ฐ™์€ ๊ฒƒ์ด ์ด์— ํ•ด๋‹นํ•˜์ฃ .
  • POST๋Š” ์„œ๋ฒ„์˜ ๊ฐ’์ด๋‚˜ ์ƒํƒœ๋ฅผ ๋ฐ”๊พธ๊ธฐ ์œ„ํ•ด์„œ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ๊ธ€์“ฐ๊ธฐ๋ฅผ ํ•˜๋ฉด ๊ธ€์˜ ๋‚ด์šฉ์ด ๋””๋น„์— ์ €์žฅ์ด ๋˜๊ณ  ์ˆ˜์ •์„ ํ•˜๋ฉด ๋””๋น„๊ฐ’์ด ์ˆ˜์ •์ด ๋˜์ฃ . ์ด๋Ÿด ๊ฒฝ์šฐ์— POST๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.