Get
β λ°μ΄ν° μ‘°νλ₯Ό λͺ©μ POST
β λ°μ΄ν°λ₯Ό ν¬ν¨ν μμ²μ λ³΄λΌ λ (μμ±)PUT
β λ°μ΄ν°λ₯Ό ν¬ν¨ν μμ²μ λ³΄λΌ λ (μμ )DELETE
β λ°μ΄ν°λ₯Ό μμ νλ μμ²μ λ³΄λΌ λπ HTTP λ²μ , μν μ½λ, μν μ½λ λ©μΈμ§
π‘ HTTP Status Code
- 100 ~ 199 : μ 보 μ 곡 λͺ©μ
- 200 ~ 299 : μμ²μ΄ μ±κ³΅μ μΌλ‘ μ²λ¦¬λμμ κ²½μ°
- 300 ~ 399 : Redirect, ν΄λΌμ΄μΈνΈμ μΆκ°μ μΈ νλμ΄ νμν κ²½μ° (301, 302)
- 400 ~ 499 : ν΄λΌμ΄μΈνΈκ° μ²λ¦¬ λΆκ°λ₯ν μμ²μ ν κ²½μ° (400 401 403 404)
- 500 ~ 599 : Internal Server Error, μλ²μ λ¬Έμ κ° μ겨 μ²λ¦¬κ° λΆκ°λ₯ν κ²½μ° (500)
path
λ₯Ό μ€μ ν΄ νμ©ν¨@RequestMapping(
Value = "/example/{pathVar}",
method = { RequestMethod.GET, RequestMethod.Post },
consumes = MediaType.APPLICATION_JSON_VALUE,
headers = "x-example=hello",
params = "example=hello"
)
public String example(@PathVariable("pathVar") String pathVar) {
log.info("GET or POST /example/" + pathVar);
return "index";
}
path
/ value
: μμ² URLμ κ²½λ‘λ₯Ό μ€μ . ν λΉλ κ²½λ‘ μΈ μμ²μλ λ©μλκ° μ€νλμ§ μμmethod
: μμ²μ HTTP Methodλ₯Ό μ€μ . ν λΉλ HTTP Methodμ λν΄μλ§ μ€νconsumes
: μμ²μ Content-Type
Headerλ₯Ό μ€μ produces
: μλ΅μ Content-Type
Headerλ₯Ό μ€μ headers
: HTTP headerλ₯Ό μ€μ . 쑰건μ μΆ©μ‘±νλ μμ²μ λν΄μλ§ λ©μλ μ€νparams
: Query Parameterλ₯Ό μ€μ . 쑰건μ μΆ©μ‘±νλ μμ²μ λν΄μλ§ λ©μλ μ€ν