๐ŸŒŸHTTP๐ŸŒŸ

GyungHo Goยท2020๋…„ 5์›” 13์ผ
0
post-thumbnail

HTTP ๋ž€?

HyperText Transfer Protocol
http๋Š” html ๋ฌธ์„œ์™€ ๊ฐ™์€ ๋ฆฌ์†Œ์Šค๋“ค์„ ๊ตํ™˜ํ•˜๊ธฐ ์œ„ํ•ด ๋งŒ๋“ค์–ด์ง„ Protocal(ํ†ต์‹ ๊ทœ์•ฝ)์ด๋‹ค. HTTP๋Š” ์›น์—์„œ ์ด๋ฃจ์–ด์ง€๋Š” ๋ชจ๋“  ๋ฐ์ดํ„ฐ ๊ตํ™˜์˜ ๊ธฐ์ดˆ์ด๋ฉฐ, ํด๋ผ์ด์–ธํŠธ-์„œ๋ฒ„ ํ”„๋กœํ† ์ฝœ์ด๊ธฐ๋„ ํ•˜๋‹ค.

  • ์ฆ‰, ์›น์ƒ์—์„œ ๋„คํŠธ์œ„ํฌ๋กœ ์„œ๋ฒ„๋ผ๋ฆฌ ํ†ต์‹ ์„ ํ•  ๋•Œ ์–ด๋– ํ•œ ํ˜•์‹์œผ๋กœ ์„œ๋กœ ํ†ต์‹ ์„ ํ•˜์ž๊ณ  ๊ทœ์ •ํ•ด ๋†“์€ "ํ†ต์‹  ํ˜•์‹" ํ˜น์€ "ํ†ต์‹  ๊ตฌ์กฐ"๋ผ๊ณ  ๋ณด๋ฉด ๋œ๋‹ค.
  • ํ”„๋ก ํŠธ ์—”๋“œ ์„œ๋ฒ„์™€ ํด๋ผ์ด์–ธํŠธ ๊ฐ„์˜ ํ†ต์‹ ์— ์‚ฌ์šฉ๋œ๋‹ค.
  • ๋ฐฑ์•ค๋“œ์™€ ํ”„๋ก ํŠธ ์•ค๋“œ ์„œ๋ฒ„๊ฐ„์—์˜ ํ†ต์‹ ์—๋„ ์‚ฌ์šฉ๋œ๋‹ค.
  • HTTP๋Š” TCP/IP ๊ธฐ๋ฐ˜์œผ๋กœ ๋˜์–ด์žˆ๋‹ค.
  • ํด๋ผ์ด์–ธํŠธ-์„œ๋ฒ„ ํ”„๋กœํ† ์ฝœ์ด๋ž€ (๋ณดํ†ต ์›น ๋ธŒ๋ผ์šฐ์ €์ธ) ์ˆ˜์‹ ์ž ์ธก์— ์˜ํ•ด ์š”์ฒญ์ด ์ดˆ๊ธฐํ™” ๋˜๋Š” ํ”„๋กœํ† ์ฝœ์„ ์˜๋ฏธํ•œ๋‹ค. ํ•˜๋‚˜์˜ ์™„์ „ํ•œ ๋ฌธ์„œ๋Š” ํ…์ŠคํŠธ, ๋ ˆ์ด์•„์›ƒ ์„ค๋ช…, ์ด๋ฏธ์ง€, ๋น„๋””์˜ค, ์Šคํฌ๋ฆฝํŠธ ๋“ฑ ๋ถˆ๋Ÿฌ์˜จ ํ•˜์œ„ ๋ฌธ์„œ๋“ค๋กœ ์žฌ๊ตฌ์„ฑ๋œ๋‹ค.

HTTP ํ•ต์‹ฌ ์š”์†Œ

HTTP ํ†ต์‹  ๋ฐฉ์‹

  • HTTP๋Š” ๊ธฐ๋ณธ์ ์œผ๋กœ ์š”์ฒญ/์‘๋‹ต (request/response) ๊ตฌ์กฐ๋กœ ๋˜์–ด์žˆ๋‹ค.
    - ์š”์ฒญ(requests)๋ž€, ๋ณดํ†ต ๋ธŒ๋ผ์šฐ์ €์ธ ํด๋ผ์ด์–ธํŠธ์— ์˜ํ•ด ์ „์†ก๋˜๋Š” ๋ฉ”์„ธ์ง€๋ฅผ ๋งํ•œ๋‹ค.
    - ์‘๋‹ต(response)๋ž€, ์„œ๋ฒ„์—์„œ ์‘๋‹ต์œผ๋กœ ์ „์†ก๋˜๋Š” ๋ฉ”์„ธ์ง€๋ฅผ ๋งํ•œ๋‹ค.
    - ํด๋ผ์ด์–ธํŠธ์™€ ์„œ๋ฒ„์˜ ๋ชจ๋“  ํ†ต์‹ ์ด ์š”์ฒญ๊ณผ ์‘๋‹ต์œผ๋กœ ์ด๋ฃจ์–ด์ง„๋‹ค.
  • HTTP๋Š” Stateless์ด๋‹ค.
    - Stateless ๋ž€ ๋ง ๊ทธ๋Œ€๋กœ state(์ƒํƒœ)๋ฅผ ์ €์žฅํ•˜์ง€ ์•Š๋Š” ๋‹ค๋Š” ๋œป์ด๋‹ค.
    • ์š”์ฒญ์ด ์˜ค๋ฉด ๊ทธ์— ์‘๋‹ต์„ ํ•  ๋ฟ, ์—ฌ๋Ÿฌ ์š”์ฒญ/์‘๋‹ต ๋ผ๋ฆฌ ์—ฐ๊ฒฐ๋˜์–ด ์žˆ์ง€ ์•Š๋Š”๋‹ค๋Š” ๋œป์ด๋‹ค. ๊ฐ๊ฐ์˜ ์š”์ฒญ/์‘๋‹ต์€ ๋…๋ฆฝ์ ์ธ ์š”์ฒญ/์‘๋‹ต์ด๋‹ค.
    • ์˜ˆ๋ฅผ๋“ค์–ด, ํด๋ผ์ด์–ธํŠธ๊ฐ€ ์š”์ฒญ์„ ๋ณด๋‚ด๊ณ  ์‘๋‹ต์„ ๋ฐ›์€ ํ›„, ์กฐ๊ธˆ ์žˆ๋‹ค ๋‹ค์‹œ ์š”์ฒญ์„ ๋ณด๋‚ผ ๋•Œ, ์ „์— ๋ณด๋‚ธ ์š”์ฒญ/์‘๋‹ต์— ๋Œ€ํ•ด ์•Œ์ง€ ๋ชปํ•œ๋‹ค๋Š” ๋œป์ด๋‹ค. ๋งŒ์ผ ์—ฌ๋Ÿฌ ์š”์ฒญ๊ณผ ์‘๋‹ต์˜ ์ง„ํ–‰๊ณผ์ •์ด๋‚˜ ๋ฐ์ดํ„ฐ๊ฐ€ ํ•„์š”ํ•  ๋•Œ๋Š” ์ฟ ํ‚ค๋‚˜ ์„ธ์…˜ ๋“ฑ์„ ์‚ฌ์šฉํ•˜๊ฒŒ ๋œ๋‹ค.

HTTP Request ๊ตฌ์กฐ

  • HTTP Request ๋ฉ”์„ธ์ง€๋Š” ํฌ๊ฒŒ 3๋ถ€๋ถ„์œผ๋กœ ๊ตฌ์„ฑ๋œ๋‹ค.
    - start line
    • headers
    • body
  1. Start Line
  • HTTP request์˜ ์ฒซ ๋ผ์ธ์ด๋‹ค.
  • HTTP request์˜ start line ๋˜ํ•œ 3๋ถ€๋ถ„์œผ๋กœ ๊ตฌ์„ฑ๋˜์–ด ์žˆ๋‹ค.
    - HTTP Method
    ํ•ด๋‹น request๊ฐ€ ์˜๋„ํ•œ action์„ ์ •์˜ํ•˜๋Š” ๋ถ€๋ถ„
    HTTP Method์—๋Š” GET, POST , PUT, DELETE, OPTIONS ๋“ฑ๋“ฑ์ด ์žˆ๋‹ค.
    ์ฃผ๋กœ GET๊ณผ POST๊ฐ€ ์“ฐ์ธ๋‹ค.
    • Request target
      ํ•ด๋‹น request๊ฐ€ ์ „์†ก๋˜๋Š” ๋ชฉํ‘œ url์„ ๋งํ•œ๋‹ค.
      ์˜ˆ๋ฅผ๋“ค์–ด /login
    • HTTP Version
      ๋ง ๊ทธ๋Œ€๋กœ ์‚ฌ์šฉ๋˜๋Š” HTTP๋ฒ„์ „, ๋ฒ„์ „์—๋Š” 1.0, 1.1, 2.0 ๋“ฑ์ด ์žˆ๋‹ค.

      GET / search HTTP / 1.1

  1. Headers
  • ํ•ด๋‹น request์— ๋Œ€ํ•œ ์ถ”๊ฐ€์ •๋ณด๋ฅผ ๋‹ด๊ณ ์žˆ๋Š” ๋ถ€๋ถ„์ด๋‹ค. ์˜ˆ๋ฅผ๋“ค์–ด, request ๋ฉ”์„ธ์ง€ body์˜ ์ด ๊ธธ์ด(Content-Length) ๋“ฑ
  • Key:Value ๊ฐ’์œผ๋กœ ๋˜์–ด์žˆ๋‹ค. (:์ด ์‚ฌ์šฉ๋จ)
    key:value
    HOST:google.com -> Key = HOST, Value = google.com
  • Headers๋„ ํฌ๊ฒŒ 3๋ถ€๋ถ„์œผ๋กœ ๋‚˜๋‰œ๋‹ค. (general headers, request headers, entity headers)
  • ์ž์ฃผ ์‚ฌ์šฉ๋˜๋Š” headers ์ •๋ณด
    1)Host
    • ์š”์ฒญ์ด ์ „์†ก๋˜๋Š” target์˜ host url: ์˜ˆ๋ฅผ๋“ค์–ด, google.com
      2)User-Agent
    • ์š”์ฒญ์„ ๋ณด๋‚ด๋Š” ํด๋ผ์ด์–ธํŠธ์— ๋Œ€ํ•œ ์ •๋ณด: ์˜ˆ๋ฅผ๋“ค์–ด, ์›น๋ธŒ๋ผ์šฐ์ €์— ๋Œ€ํ•œ ์ •๋ณด์ด๋‹ค.
      3)Accept
    • ํ•ด๋‹น ์š”์ฒญ์ด ๋ฐ›์„ ์ˆ˜ ์žˆ๋Š” ์‘๋‹ต(respense)ํƒ€์ž…
      4)Connection
    • ํ•ด๋‹น ์š”์ฒญ์ด ๋๋‚œ ํ›„์— ํด๋ผ์ด์–ธํŠธ์™€ ์„œ๋ฒ„๊ฐ€ ๊ณ„์† ๋„คํŠธ์›Œํฌ ์ปค๋„ฅ์…˜์„ ์œ ์ง€ํ•  ๊ฒƒ์ธ์ง€ ์•„๋‹ˆ๋ฉด ๋Š์„ ๊ฒƒ์ธ์ง€์— ๋Œ€ํ•ด ์ง€์‹œํ•˜๋Š” ๋ถ€๋ถ„์ด๋‹ค.
      5)Content-Type
    • ํ•ด๋‹น ์š”์ฒญ์ด ๋ณด๋‚ด๋Š” ๋ฉ”์„ธ์ง€ body์˜ ํƒ€์ž…์ด๋‹ค. ์˜ˆ๋ฅผ๋“ค์–ด, JSON์„ ๋ณด๋‚ด๋ฉด application/json
      6)Content-Length
    • ๋ฉ”์„ธ์ง€ body์˜ ๊ธธ์ด
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Type: application/json
Content-Length: 257
Host: google.com
User-Agent: HTTPie/0.9.3
  1. Body
  • ํ•ด๋‹น reqeust์˜ ์‹ค์ œ ๋ฉ”์„ธ์ง€/๋‚ด์šฉ
  • Body๊ฐ€ ์—†๋Š” request๋„ ๋งŽ๋‹ค. ์˜ˆ๋ฅผ๋“ค์–ด, GET request๋“ค์€ ๋Œ€๋ถ€๋ถ„ body๊ฐ€ ์—†๋Š” ๊ฒฝ์šฐ๊ฐ€ ๋งŽ๋‹ค.
POST /payment-sync HTTP/1.1

Accept: application/json
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 83
Content-Type: application/json
Host: intropython.com
User-Agent: HTTPie/0.9.3

{
    "imp_uid": "imp_1234567890",
    "merchant_uid": "order_id_8237352",
    "status": "paid"
}

HTTP response ๊ตฌ์กฐ

  • Response๋„ request์™€ ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ ํฌ๊ฒŒ 3๋ถ€๋ถ„์œผ๋กœ ๊ตฌ์„ฑ๋˜์–ด์žˆ๋‹ค.
    1)Status line
    2)Headers
    3)Body

1) Status Line
Response์˜ ์ƒํƒœ๋ฅผ ๊ฐ„๋žตํ•˜๊ฒŒ ๋‚˜ํƒ€๋‚ด์ฃผ๋Š” ๋ถ€๋ถ„์ด๋‹ค. 3๋ถ€๋ถ„์œผ๋กœ ๊ตฌ์„ฑ๋˜์–ด์žˆ๋‹ค.
- HTTP๋ฒ„์ „
- Status code:์‘๋‹ต ์ƒํƒœ๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” ์ฝ”๋“œ, ์ˆซ์ž๋กœ ๋˜์–ด์žˆ๋Š” ์ฝ”๋“œ์ด๋‹ค. ์˜ˆ๋ฅผ๋“ค์–ด, 200
- Status text:์‘๋‹ต์ƒํƒœ๋ฅผ ๊ฐ„๋žตํ•˜๊ฒŒ ์„ค๋ช…ํ•ด ์ฃผ๋Š” ๋ถ€๋ถ„์ด๋‹ค. ์˜ˆ๋ฅผ๋“ค์–ด, "Not Found"

>HTTP/1.1 404 Not Found

2) Headers
Response์˜ headers์™€ ๋™์ผํ•˜๋‹ค. ๋‹ค๋งŒ response์—์„œ๋งŒ ์‚ฌ์šฉ๋˜๋Š” header ๊ฐ’๋“ค์ด ์žˆ๋‹ค. ์˜ˆ๋ฅผ๋“ค์–ด, User-Agent ๋Œ€์‹ ์— Serverํ—ค๋”๊ฐ€ ์‚ฌ์šฉ๋œ๋‹ค.

3) Body
Response์˜ body์™€ ์ผ๋ฐ˜์ ์œผ๋กœ ๋™์ผํ•˜๋‹ค. Request์™€ ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ ๋ชจ๋“  response๊ฐ€ body๊ฐ€ ์žˆ์ง€๋Š” ์•Š๋‹ค. ๋ฐ์ดํ„ฐ๋ฅผ ์ „์†กํ•  ํ•„์š”๊ฐ€ ์—†์„๊ฒฝ์šฐ body๊ฐ€ ๋น„์–ด์žˆ๊ฒŒ ๋œ๋‹ค.

HTTP/1.1 404 Not Found

Connection: close
Content-Length: 1573
Content-Type: text/html; charset=UTF-8
Date: Mon, 20 Aug 2018 07:59:05 GMT

<!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 404 (Not Found)!!1</title>
  <style>
    *{margin:0;padding:0}html,cod.....์ƒ๋žต.......
  </style>
  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
  <p><b>404.</b> <ins>Thatโ€™s an error.</ins>
  <p>The requested URL <code>/payment-sync</code> was not found on this server.  <ins>Thatโ€™s all we know.</ins>

์ž์ฃผ ์“ฐ์ด๋Š” HTTP Methods

  1. GET
    ์ด๋ฆ„ ๊ทธ๋Œ€๋กœ ์–ด๋–ค ๋ฐ์ดํ„ฐ๋ฅผ ์„œ๋ฒ„๋กœ ๋ถ€ํ„ฐ ๋ฐ›์•„(GET)์„๋•Œ ์ฃผ๋กœ ์‚ฌ์šฉ๋˜๋Š” ๋ฉ”์†Œ๋“œ ์ด๋‹ค. ๋ฐ์ดํ„ฐ ์ƒ์„ฑ/์ˆ˜์ •/์‚ญ์ œ ์—†์ด ๋ฐ›์•„์˜ค๊ธฐ๋งŒ ํ•  ๋•Œ ์‚ฌ์šฉ๋œ๋‹ค. ๊ฐ€์žฅ ๊ฐ„๋‹จํ•˜๊ณ  ๋งŽ์ด ์‚ฌ์šฉ๋˜๋Š” HTTP Method์ด๋‹ค. ์•ž์—์„œ ๋งํ•œ๋Œ€๋กœ ์ฃผ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ๋ฐ›์•„์˜ฌ๋–„ ์‚ฌ์šฉ๋˜๊ธฐ ๋•Œ๋ฌธ์— request์— body๋ฅผ ์•ˆ ๋ณด๋‚ด๋Š” ๊ฒฝ์šฐ๊ฐ€ ๋งŽ๋‹ค.

  2. POST
    ๋ฐ์ดํ„ฐ๋ฅผ ์ƒ์„ฑ/์ˆ˜์ •/์‚ญ์ œ ํ• ๋•Œ ์ฃผ๋กœ ์‚ฌ์šฉ๋˜๋Š” Method์ด๋‹ค. ๋ฐ์ดํ„ฐ๋ฅผ ์ƒ์„ฑ ๋ฐ ์ˆ˜์ • ํ•  ๋•Œ ๋งŽ์ด ์‚ฌ์šฉํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๋Œ€๋ถ€๋ถ„์˜ ๊ฒฝ์šฐ request body๊ฐ€ ํฌํ•จ๋˜์„œ ๋ณด๋‚ด์ง„๋‹ค.

์•Œ๊ณ  ์žˆ์œผ๋ฉด ์ข‹์€ Methods

  1. OPTIONS
    ์ฃผ๋กœ ์š”์ฒญ URI์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” Method๋ฅผ ๋ฐ›์•„์˜ฌ๋•Œ ์‚ฌ์šฉ๋œ๋‹ค. ์˜ˆ๋ฅผ๋“ค์–ด, /update url์—์„œ ์–ด๋–ค method๋ฅผ ์š”์ฒญ ๊ฐ€๋Šฅํ•œ๊ฐ€๋ฅผ ์•Œ๊ณ  ์‹ถ์œผ๋ฉด ๋จผ์ € OPTIONS ์š”์ฒญ์„ ์‚ฌ์šฉํ•ด์„œ ํ™•์ธํ•˜๊ฒŒ ๋œ๋‹ค.
http -v OPTIONS http://example.org

OPTIONS / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 0
Host: example.org
User-Agent: HTTPie/0.9.3

HTTP/1.1 200 OK
Allow: OPTIONS, GET, HEAD, POST
Cache-Control: max-age=604800
Content-Length: 0
Date: Mon, 20 Aug 2018 08:37:45 GMT
Expires: Mon, 27 Aug 2018 08:37:45 GMT
Server: EOS (vny006/0450)
  1. PUT
    POST์™€ ๋น„์Šทํ•˜๋‹ค. ๋ฐ์ดํ„ฐ๋ฅผ ์ƒ์„ฑํ•  ๋•Œ ์‚ฌ์šฉ๋˜๋Š” Method์ด๋‹ค. POST์™€ ๊ฒน์น˜๊ธฐ ๋•Œ๋ฌธ์— PUT๋กœ ํ†ต์ผํ•ด์„œ ์‚ฌ์šฉํ•˜๋Š” ๊ณณ๋„ ์žˆ๋Š”๋ฐ, ์ตœ๊ทผ ๋ช‡๋…„ ์‚ฌ์ด์— POST์— ๋ฐ€๋ ค์„œ ์ž˜ ์‚ฌ์šฉ ์•ˆํ•˜๋Š” ์ถ”์„ธ์ด๋‹ค.

  2. DELETE
    ํŠน์ • ๋ฐ์ดํ„ฐ๋ฅผ ์„œ๋ฒ„์—์„œ ์‚ญ์ œ ์š”์ฒญ์„ ๋ณด๋‚ผ ๋•Œ ์“ฐ์ด๋Š” Method์ด๋‹ค. PUT๊ณผ ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ POST์— ๋ฐ€๋ ค์„œ ์ž˜ ์‚ฌ์šฉ ์•ˆ๋˜๋Š” ์ถ”์„ธ์ด๋‹ค.

์ž์ฃผ ์“ฐ์ด๋Š” HTTP Status Code

  1. 200 OK
    ๊ฐ€์žฅ ์ž์ฃผ ๋ณด๊ฒŒ๋˜๋Š” status code์ด๋‹ค. ๋ฌธ์ œ ์—†์ด ๋‹ค ์ž˜ ์‹คํ–‰๋˜์—ˆ์„๋•Œ ๋ณด๋‚ด๋Š” ์ฝ”๋“œ์ด๋‹ค.

  2. 301 Moved Permanently
    ํ•ด๋‹น URI๊ฐ€ ๋‹ค๋ฅธ ์ฃผ์†Œ๋กœ ๋ฐ”๋€Œ์—ˆ์„ ๋•Œ ๋ณด๋‚ด๋Š” ์ฝ”๋“œ์ด๋‹ค.

HTTP/1.1 301 Moved Permanently
Location: http://www.example.org/index.asp
  1. 400 Bad Request
    ํ•ด๋‹น ์š”์ฒญ์ด ์ž˜๋ชป ๋œ ์š”์ฒญ์ผ๋•Œ ๋ณด๋‚ด๋Š” ์ฝ”๋“œ์ด๋‹ค. ์ฃผ๋กœ ์š”์ฒญ์— ํฌํ•จ๋œ input๊ฐ’๋“ค์ด ์ž˜๋ชป๋œ ๊ฐ’๋“ค์ด ๋ณด๋‚ด์กŒ์„ ๋•Œ ์‚ฌ์šฉ๋˜๋Š” ์ฝ”๋“œ์ด๋‹ค. ์˜ˆ๋ฅผ๋“ค์–ด, ์ „ํ™”๋ฒˆํ˜ธ๋ฅผ ๋ณด๋‚ด์•ผ ๋˜๋Š”๋ฐ text๊ฐ€ ๋ณด๋‚ด์กŒ์„ ๋•Œ ๋“ฑ

  2. 401 Unauthorized
    ์œ ์ €๊ฐ€ ํ•ด๋‹น ์š”์ฒญ์„ ์ง„ํ–‰ ํ• ๋ ค๋ฉด ๋จผ์ € ๋กœ๊ทธ์ธ์„ ํ•˜๊ฑฐ๋‚˜ ํšŒ์› ๊ฐ€์ž…์„ ํ•˜๊ฑฐ๋‚˜ ๋“ฑ์ด ํ•„์š”ํ•˜๋‹ค๋Š” ๊ฒƒ์„ ๋‚˜ํƒ€๋‚ด๋ ค ํ•  ๋•Œ ์“ฐ์ด๋Š” ์ฝ”๋“œ์ด๋‹ค.

  3. 403 Forbidden
    ์œ ์ €๊ฐ€ ํ•ด๋‹น ์š”์ฒญ์— ๋Œ€ํ•œ ๊ถŒํ•œ์ด ์—†๋‹ค๋Š” ๋œป์ด๋‹ค. ์˜ˆ๋ฅผ๋“ค์–ด, ๋ฌด๋ฃŒํšŒ์›, ์œ ๋ฃŒํšŒ์›์˜ ์ ‘๊ทผ ๊ถŒํ•œ๋“ฑ

  4. 404 Not Found
    ์š”์ฒญ๋œ uri๊ฐ€ ์กด์žฌํ•˜์ง€ ์•Š๋‹ค๋Š” ๋œป์ด๋‹ค.

  5. 500 Internal Server Error
    ์„œ๋ฒ„์—์„œ ์—๋Ÿฌ๊ฐ€ ๋‚ฌ์„ ๋•Œ ์‚ฌ์šฉ๋˜๋Š” ์ฝ”๋“œ์ด๋‹ค. API๊ฐœ๋ฐœ์„ ํ•˜๋Š” ๋ฐฑ์•ค๋“œ ๊ฐœ๋ฐœ์ž๋“ค์ด ์‹ซ์–ดํ•˜๋Š” ์ฝ”๋“œ์ด๋‹ค.

๋ฒˆ์™ธ
๋ธ”๋กœ๊ทธ๋ฅผ ์“ฐ๋‹ค๋ณด๋‹ˆ URI์™€ URL์ด ๋ณด์˜€๋‹ค. ์ด ๋‘˜์˜ ์ฐจ์ด์ ์„ ๊ฐ„๋‹จํ•˜๊ฒŒ ์ •๋ฆฌํ•ด ๋ณด๋ ค๊ณ  ํ•œ๋‹ค.

URI ( Uniform Resource Identifier)

ํ†ตํ•ฉ ์ž์› ์‹๋ณ„์ž(ID)**๋กœ์จ, ์ธํ„ฐ๋„ท์˜ ์ฃผ์†Œ ๊ฐ™์€ ๊ฒƒ์œผ๋กœ, ์ •๋ณด ๋ฆฌ์†Œ์Šค๋ฅผ ๊ณ ์œ ํ•˜๊ฒŒ ์‹๋ณ„ํ•˜๊ณ  ์œ„์น˜๋ฅผ ์ง€์ •ํ•  ์ˆ˜ ์žˆ๋‹ค.

URL (Uniform Resource Locator)

ํŠน์ • ์„œ๋ฒ„์˜ ํ•œ ๋ฆฌ์†Œ์Šค์— ๋Œ€ํ•œ ๊ตฌ์ฒด์ ์ธ ์œ„์น˜๋ฅผ ์„œ์ˆ ํ•œ๋‹ค. URL์€ ๋ฆฌ์†Œ์Šค๊ฐ€ ์ •ํ™•ํžˆ ์–ด๋””์— ์žˆ๊ณ  ์–ด๋–ป๊ฒŒ ์ ‘๊ทผํ•  ์ˆ˜ ์žˆ๋Š”์ง€ ๋ถ„๋ช…ํžˆ ์•Œ๋ ค์ค€๋‹ค.

URN (Uniform Resource Name)

์ฝ˜ํ…์ธ ๋ฅผ ์ด๋ฃจ๋Š” ํ•œ ๋ฆฌ์†Œ์Šค์— ๋Œ€ํ•ด, ๊ทธ ๋ฆฌ์†Œ์Šค์˜ ์œ„์น˜์— ์˜ํ–ฅ ๋ฐ›์ง€ ์•Š๋Š” ์œ ์ผ๋ฌด์ดํ•œ ์ด๋ฆ„์„ ๋งํ•œ๋‹ค.
์ด ์œ„์น˜ ๋…๋ฆฝ์ ์ธ URN์€ ๋ฆฌ์†Œ์Šค๋ฅผ ์—ฌ๊ธฐ์ €๊ธฐ ์˜ฎ๊ธฐ๋”๋ผ๋„ ๋ฌธ์ œ์—†์ด ๋™์ž‘ํ•œ๋‹ค. ๋ฆฌ์†Œ์Šค๊ฐ€ ๊ทธ ์ด๋ฆ„์„ ๋ณ€ํ•˜์ง€ ์•Š๊ฒŒ ์œ ์ง€ํ•˜๋Š” ํ•œ, ์—ฌ๋Ÿฌ์ข…๋ฅ˜์˜ ๋„คํŠธ์›Œํฌ ์ ‘์† ํ”„๋กœํ† ์ฝœ๋กœ ์ ‘๊ทผํ•ด๋„ ๋ฌธ์ œ๊ฐ€ ์—†๋‹ค.
๋”ฐ๋ผ์„œ, ๋ฌด์—‡์ธ์ง€๋ฅผ ๋งํ•˜๋Š” What์˜ ๊ฐœ๋…์œผ๋กœ ์„œ๋กœ ์ค‘๋ณต๋˜์ง€ ์•Š๋Š” ์œ ์ผํ•œ ๊ฐ’์ด์–ด์•ผํ•œ๋‹ค

profile
๊ธฐ๋กํ•˜๋Š” ์Šต๊ด€

0๊ฐœ์˜ ๋Œ“๊ธ€