{"id":38558,"date":"2024-11-01T18:18:16","date_gmt":"2024-11-01T18:18:16","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=38558"},"modified":"2024-11-26T06:44:00","modified_gmt":"2024-11-26T06:44:00","slug":"fastapi-%ec%84%9c%eb%b2%84%ea%b0%9c%eb%b0%9c-%ec%9a%94%ec%b2%ad-%eb%b0%94%eb%94%94","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/38558\/","title":{"rendered":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc694\uccad \ubc14\ub514"},"content":{"rendered":"<p><body><\/p>\n<header>\n<\/header>\n<section>\n<h2>1. FastAPI\ub780?<\/h2>\n<p>FastAPI\ub294 Python \uae30\ubc18\uc758 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, API\ub97c \ube60\ub974\uace0 \uc27d\uac8c \uad6c\ucd95\ud560 \uc218 \uc788\ub3c4\ub85d \uc124\uacc4\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \ube44\ub3d9\uae30\uc801\uc774\uba70, \ud0c0\uc785 \uc8fc\uc11d(type hint)\uc744 \uc9c0\uc6d0\ud558\uc5ec \uc790\ub3d9\ud654\ub41c \ubb38\uc11c\ud654\uc640 \uc720\ud6a8\uc131 \uac80\uc0ac\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4. FastAPI\ub97c \uc0ac\uc6a9\ud558\uba74 RESTful API\ub97c \ube60\ub974\uac8c \uad6c\ud604\ud560 \uc218 \uc788\uc73c\uba70, \ub192\uc740 \uc131\ub2a5\uc744 \uc790\ub791\ud569\ub2c8\ub2e4.<\/p>\n<\/section>\n<section>\n<h2>2. \uc694\uccad \ubc14\ub514\ub780?<\/h2>\n<p>HTTP \uc694\uccad \ubc14\ub514\ub294 \ud074\ub77c\uc774\uc5b8\ud2b8\uac00 \uc11c\ubc84\uc5d0 \ub370\uc774\ud130\ub97c \uc804\ub2ec\ud560 \ub54c \uc0ac\uc6a9\ud558\ub294 \ubc29\ubc95 \uc911 \ud558\ub098\uc785\ub2c8\ub2e4. \uc8fc\ub85c POST, PUT, PATCH \ub4f1\uc758 HTTP \uba54\uc11c\ub4dc\uc640 \ud568\uaed8 \uc0ac\uc6a9\ub429\ub2c8\ub2e4. \uc694\uccad \ubc14\ub514\ub97c \ud1b5\ud574 JSON, XML, Form Data \ub4f1\uc758 \ud615\uc2dd\uc73c\ub85c \ub370\uc774\ud130\ub97c \uc804\uc1a1\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<\/section>\n<section>\n<h2>3. FastAPI\uc758 \uc694\uccad \ubc14\ub514 \ucc98\ub9ac<\/h2>\n<p>FastAPI\uc5d0\uc11c\ub294 \uc694\uccad \ubc14\ub514\ub97c \uc27d\uac8c \ucc98\ub9ac\ud560 \uc218 \uc788\ub3c4\ub85d \ub2e4\uc591\ud55c \ubc29\ubc95\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4. \uc774 \uc139\uc158\uc5d0\uc11c\ub294 FastAPI\uc5d0\uc11c \uc694\uccad \ubc14\ub514\ub97c \ucc98\ub9ac\ud558\ub294 \uae30\ubcf8\uc801\uc778 \ubc29\ubc95\uacfc \uc608\uc81c\ub97c \ub2e4\ub8e8\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<\/section>\n<section>\n<h3>3.1. Pydantic\uc744 \uc0ac\uc6a9\ud55c \uc694\uccad \ubc14\ub514\uc758 \uc815\uc758<\/h3>\n<p>FastAPI\ub294 Pydantic\uc744 \uc0ac\uc6a9\ud558\uc5ec \uc720\ud6a8\ud55c \ub370\uc774\ud130 \ubaa8\ub378\uc744 \uc815\uc758\ud569\ub2c8\ub2e4. Pydantic \ubaa8\ub378\uc744 \uc815\uc758\ud558\uba74 \uc694\uccad \ubc14\ub514\uc758 \uad6c\uc870\ub97c \uac15\uc81c\ub85c \uc9c0\uc815\ud560 \uc218 \uc788\uc73c\uba70, \ub370\uc774\ud130 \uac80\uc99d \ubc0f \uc9c1\ub82c\ud654\/\uc5ed\uc9c1\ub82c\ud654\ub97c \uc27d\uac8c \ucc98\ub9ac\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code>\nfrom fastapi import FastAPI\nfrom pydantic import BaseModel\n\napp = FastAPI()\n\nclass Item(BaseModel):\n    name: str\n    price: float\n    is_offer: bool = None\n\n@app.post(\"\/items\/\")\nasync def create_item(item: Item):\n    return item\n        <\/code><\/pre>\n<p>\uc704\uc758 \uc608\uc81c\uc5d0\uc11c\ub294 <code>Item<\/code>\uc774\ub77c\ub294 Pydantic \ubaa8\ub378\uc744 \uc815\uc758\ud588\uc2b5\ub2c8\ub2e4. \uc774 \ubaa8\ub378\uc740 <code>name<\/code>, <code>price<\/code>, <code>is_offer<\/code>\ub77c\ub294 \uc138 \uac00\uc9c0 \uc18d\uc131\uc744 \uac00\uc9c0\uace0 \uc788\uc2b5\ub2c8\ub2e4. <code>create_item<\/code> \ud568\uc218\ub294 POST \uc694\uccad\uc744 \ud1b5\ud574 <code>Item<\/code> \uac1d\uccb4\ub97c \uc0dd\uc131\ud558\uace0 \ubc18\ud658\ud569\ub2c8\ub2e4.<\/p>\n<\/section>\n<section>\n<h3>3.2. \uc694\uccad \ubc14\ub514\uc758 \ud0c0\uc785 \uc9c0\uc815<\/h3>\n<p>FastAPI\ub294 \uc694\uccad \ubc14\ub514\uc758 \ud0c0\uc785\uc744 \uc790\ub3d9\uc73c\ub85c \uc9c0\uc815\ud558\uc5ec \uc801\uc808\ud55c \ub370\uc774\ud130 \ud615\uc2dd\uc744 \uc0ac\uc6a9\ud558\ub3c4\ub85d \ub3c4\uc640\uc90d\ub2c8\ub2e4. \uc704\uc758 \uc608\uc81c\uc5d0\uc11c <code>item: Item<\/code>\uc740 FastAPI\uc5d0\uac8c \uc774 \uc694\uccad\uc774 <code>Item<\/code> \ubaa8\ub378\uc5d0 \uc758\ud574 \uc815\uc758\ub41c \ud615\uc2dd\uc744 \uac16\ucd94\uc5b4\uc57c \ud568\uc744 \uc54c\ub9bd\ub2c8\ub2e4.<\/p>\n<pre><code>\nfrom fastapi import FastAPI, HTTPException\nfrom pydantic import BaseModel\n\napp = FastAPI()\n\nclass User(BaseModel):\n    username: str\n    email: str\n    full_name: str = None\n\n@app.post(\"\/users\/\")\nasync def create_user(user: User):\n    if user.username == \"admin\":\n        raise HTTPException(status_code=400, detail=\"Username 'admin' is not allowed.\")\n    return user\n        <\/code><\/pre>\n<p>\uc704\uc758 \uc608\uc81c\uc5d0\uc11c <code>create_user<\/code> \ud568\uc218\ub294 <code>User<\/code> \ubaa8\ub378\uc758 \uc778\uc2a4\ud134\uc2a4\ub97c \uae30\ub300\ud558\uba70, \uc0ac\uc6a9\uc790\uac00 &#8216;admin&#8217;\uc774\ub77c\ub294 \uc774\ub984\uc744 \uc0ac\uc6a9\ud560 \uacbd\uc6b0 \uc608\uc678\ub97c \ubc1c\uc0dd\uc2dc\ud0b5\ub2c8\ub2e4.<\/p>\n<\/section>\n<section>\n<h2>4. \uc694\uccad \ubc14\ub514\uc640 \ub2e4\uc591\ud55c MIME \ud0c0\uc785<\/h2>\n<p>FastAPI\ub294 \uc5ec\ub7ec \uac00\uc9c0 MIME \ud0c0\uc785\uc744 \uc9c0\uc6d0\ud569\ub2c8\ub2e4. \uc5ec\uae30\uc11c\ub294 JSON\uacfc Form Data\uc758 \uc694\uccad \ubc14\ub514\ub97c \ucc98\ub9ac\ud558\ub294 \ubc29\ubc95\uc744 \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<\/section>\n<section>\n<h3>4.1. JSON \uc694\uccad \ubc14\ub514 \ucc98\ub9ac<\/h3>\n<p>FastAPI\ub294 \uae30\ubcf8\uc801\uc73c\ub85c JSON \ud615\uc2dd\uc758 \uc694\uccad \ubc14\ub514\ub97c \ucc98\ub9ac\ud569\ub2c8\ub2e4. \ud074\ub77c\uc774\uc5b8\ud2b8\uac00 JSON \ub370\uc774\ud130\ub97c \uc694\uccad \ubc14\ub514\ub85c \uc804\uc1a1\ud558\uba74, FastAPI\ub294 \uc790\ub3d9\uc73c\ub85c \uc774\ub97c Python \uac1d\uccb4\ub85c \ubcc0\ud658\ud569\ub2c8\ub2e4.<\/p>\n<pre><code>\n@app.post(\"\/json\/\")\nasync def read_json(item: Item):\n    return {\"item_name\": item.name, \"item_price\": item.price}\n        <\/code><\/pre>\n<p>\uc704\uc758 \uc608\uc81c\uc5d0\uc11c \ud074\ub77c\uc774\uc5b8\ud2b8\uac00 JSON \ud615\uc2dd\uc73c\ub85c \uc694\uccad\uc744 \ubcf4\ub0b4\uba74 FastAPI\uac00 \uc774\ub97c <code>Item<\/code> \uac1d\uccb4\ub85c \ubcc0\ud658\ud558\uace0, \uc11c\ubc84\ub294 \ud574\ub2f9 \uac1d\uccb4\uc758 \uc18d\uc131\uc744 \uc0ac\uc6a9\ud558\uc5ec \uc751\ub2f5\uc744 \uad6c\uc131\ud569\ub2c8\ub2e4.<\/p>\n<\/section>\n<section>\n<h3>4.2. Form Data \uc694\uccad \ubc14\ub514 \ucc98\ub9ac<\/h3>\n<p>FastAPI\ub294 Form Data \ud615\uc2dd\uc73c\ub85c \ub370\uc774\ud130\ub97c \ucc98\ub9ac\ud558\ub294 \ubc29\ubc95\ub3c4 \uc81c\uacf5\ud569\ub2c8\ub2e4. \uc774 \uacbd\uc6b0\uc5d0\ub294 <code>Form<\/code> \ud568\uc218\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc694\uccad \ubc14\ub514\uc758 \ub370\uc774\ud130\ub97c \uc5bb\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code>\nfrom fastapi import Form\n\n@app.post(\"\/form\/\")\nasync def create_form(username: str = Form(...), password: str = Form(...)):\n    return {\"username\": username, \"password\": password}\n        <\/code><\/pre>\n<p>\uc774 \ubc29\ubc95\uc740 HTML \ud3fc\uc744 \ud1b5\ud574 \ub370\uc774\ud130\ub97c \uc804\ub2ec\ud560 \ub54c \uc720\uc6a9\ud558\uac8c \uc0ac\uc6a9\ub420 \uc218 \uc788\uc2b5\ub2c8\ub2e4. <code>Form(...)<\/code>\ub294 \ud544\uc218 \ud544\ub4dc\uc784\uc744 \ub098\ud0c0\ub0c5\ub2c8\ub2e4.<\/p>\n<\/section>\n<section>\n<h2>5. \uc5d0\ub7ec \ucc98\ub9ac<\/h2>\n<p>FastAPI\ub294 \ub370\uc774\ud130 \uc720\ud6a8\uc131 \uac80\uc0ac\ub97c \ud1b5\ud574 \ubc1c\uc0dd\ud558\ub294 \uc624\ub958\ub97c \uc790\ub3d9\uc73c\ub85c \ucc98\ub9ac\ud569\ub2c8\ub2e4. \uc798\ubabb\ub41c \ub370\uc774\ud130 \ud615\uc2dd\uc774 \uc694\uccad\ub418\uba74, FastAPI\ub294 HTTP 422 \uc0c1\ud0dc \ucf54\ub4dc\uc640 \ud568\uaed8 \uc624\ub958 \uba54\uc2dc\uc9c0\ub97c \ubc18\ud658\ud569\ub2c8\ub2e4.<\/p>\n<pre><code>\n@app.post(\"\/error\/\")\nasync def create_user(user: User):\n    return user\n\n# \ud074\ub77c\uc774\uc5b8\ud2b8\uac00 \uc798\ubabb\ub41c \ub370\uc774\ud130 \ud615\uc2dd\uc73c\ub85c \uc694\uccad\ud560 \uacbd\uc6b0:\n# {\"username\": 123, \"email\": \"invalid email\"}\n        <\/code><\/pre>\n<p>\uc704\uc640 \uac19\uc774 \uc798\ubabb\ub41c \ub370\uc774\ud130\uac00 \ub4e4\uc5b4\uc62c \uacbd\uc6b0 FastAPI\ub294 \uc790\ub3d9\uc73c\ub85c \uc5d0\ub7ec \uba54\uc2dc\uc9c0\ub97c \uc0dd\uc131\ud558\uc5ec \ud074\ub77c\uc774\uc5b8\ud2b8\uc5d0 \uc804\ub2ec\ud569\ub2c8\ub2e4.<\/p>\n<\/section>\n<section>\n<h2>6. \uc694\uccad \ubc14\ub514\uc640 \ubcf4\uc548<\/h2>\n<p>\uc694\uccad \ubc14\ub514\ub97c \ucc98\ub9ac\ud560 \ub54c\ub294 \ubcf4\uc548 \uc5ed\uc2dc \uc911\uc694\ud55c \uc694\uc18c\uc785\ub2c8\ub2e4. \uc678\ubd80\uc5d0\uc11c \ub4e4\uc5b4\uc624\ub294 \ub370\uc774\ud130\ub294 \ud56d\uc0c1 \uac80\uc99d\ud558\uace0 \uc885\ub958\ub97c \uc815\ud655\ud788 \ud30c\uc545\ud574\uc57c \ud569\ub2c8\ub2e4. FastAPI\ub294 SQL \uc778\uc81d\uc158, XSS\uc640 \uac19\uc740 \uacf5\uaca9\uc744 \ubc29\uc9c0\ud558\uae30 \uc704\ud55c \ub2e4\uc591\ud55c \uae30\ub2a5\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4.<\/p>\n<p>\ucd94\uac00\uc801\uc73c\ub85c FastAPI\ub294 OAuth2, JWT \ub4f1\uc758 \ubcf4\uc548 \uae30\ub2a5\uc744 \uc9c0\uc6d0\ud558\uc5ec \uc778\uc99d \ubc0f \uad8c\ud55c \ubd80\uc5ec\ub97c \uc81c\uacf5\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<\/section>\n<section>\n<h2>7. FastAPI\uc758 \uc694\uccad \ubc14\ub514 \uae30\ub2a5 \uc694\uc57d<\/h2>\n<p>FastAPI\ub294 \uc694\uccad \ubc14\ub514\ub97c \ucc98\ub9ac\ud558\ub294 \ub370 \uc788\uc5b4 \ub9e4\uc6b0 \uc720\uc5f0\ud558\uace0 \uac15\ub825\ud55c \uae30\ub2a5\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4. Pydantic \ubaa8\ub378\uc744 \ud65c\uc6a9\ud558\uc5ec \ub370\uc774\ud130 \uad6c\uc870\ub97c \uc815\uc758\ud558\uace0, \ub2e4\uc591\ud55c \ud615\uc2dd\uc758 \ub370\uc774\ud130\ub97c \uc9c0\uc6d0\ud569\ub2c8\ub2e4. JSON, Form Data, Multipart \ub4f1\uc758 \ud615\uc2dd\uc744 \uc27d\uac8c \ucc98\ub9ac\ud560 \uc218 \uc788\uc73c\uba70, \uc624\ub958 \ucc98\ub9ac\uac00 \uc6a9\uc774\ud569\ub2c8\ub2e4.<\/p>\n<p>\ub610\ud55c FastAPI\ub294 \ube44\ub3d9\uae30 \ucc98\ub9ac\ub97c \uc9c0\uc6d0\ud558\ubbc0\ub85c, \ub192\uc740 \uc131\ub2a5\uc744 \uc720\uc9c0\ud558\uba74\uc11c\ub3c4 \ubcf5\uc7a1\ud55c \ub370\uc774\ud130 \uc694\uccad\uc744 \ucc98\ub9ac\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<\/section>\n<footer>\n<h2>8. \ub9c8\uce58\uba70<\/h2>\n<p>FastAPI\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc694\uccad \ubc14\ub514\ub97c \ucc98\ub9ac\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \uc54c\uc544\ubcf4\uc558\uc2b5\ub2c8\ub2e4. \uc774 \uac15\uc88c\ub97c \ud1b5\ud574 FastAPI\uc758 \uae30\ub2a5\uc744 \ud65c\uc6a9\ud558\uc5ec \ubcf4\ub2e4 \uc548\uc815\uc801\uc774\uace0 \ud6a8\uc728\uc801\uc778 \uc6f9 API\ub97c \uad6c\ucd95\ud560 \uc218 \uc788\uae30\ub97c \ubc14\ub78d\ub2c8\ub2e4.<\/p>\n<p>\uc774\uc81c \uc5ec\ub7ec\ubd84\uc740 FastAPI \uc11c\ubc84\uc5d0\uc11c \uc694\uccad \ubc14\ub514\ub97c \ud6a8\uacfc\uc801\uc73c\ub85c \ucc98\ub9ac\ud560 \uc218 \uc788\ub294 \ub2a5\ub825\uc744 \uac16\ucd94\uc5c8\uc2b5\ub2c8\ub2e4. \uc55e\uc73c\ub85c\uc758 \ud504\ub85c\uc81d\ud2b8\uc5d0\uc11c \uc774\ub97c \ud65c\uc6a9\ud574 \ubcf4\uc138\uc694!<\/p>\n<\/footer>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. FastAPI\ub780? FastAPI\ub294 Python \uae30\ubc18\uc758 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, API\ub97c \ube60\ub974\uace0 \uc27d\uac8c \uad6c\ucd95\ud560 \uc218 \uc788\ub3c4\ub85d \uc124\uacc4\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \ube44\ub3d9\uae30\uc801\uc774\uba70, \ud0c0\uc785 \uc8fc\uc11d(type hint)\uc744 \uc9c0\uc6d0\ud558\uc5ec \uc790\ub3d9\ud654\ub41c \ubb38\uc11c\ud654\uc640 \uc720\ud6a8\uc131 \uac80\uc0ac\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4. FastAPI\ub97c \uc0ac\uc6a9\ud558\uba74 RESTful API\ub97c \ube60\ub974\uac8c \uad6c\ud604\ud560 \uc218 \uc788\uc73c\uba70, \ub192\uc740 \uc131\ub2a5\uc744 \uc790\ub791\ud569\ub2c8\ub2e4. 2. \uc694\uccad \ubc14\ub514\ub780? HTTP \uc694\uccad \ubc14\ub514\ub294 \ud074\ub77c\uc774\uc5b8\ud2b8\uac00 \uc11c\ubc84\uc5d0 \ub370\uc774\ud130\ub97c \uc804\ub2ec\ud560 \ub54c \uc0ac\uc6a9\ud558\ub294 \ubc29\ubc95 \uc911 \ud558\ub098\uc785\ub2c8\ub2e4. \uc8fc\ub85c POST, PUT, PATCH \ub4f1\uc758 &hellip; <a href=\"https:\/\/atmokpo.com\/w\/38558\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc694\uccad \ubc14\ub514&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[183],"tags":[],"class_list":["post-38558","post","type-post","status-publish","format-standard","hentry","category-fastapi"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc694\uccad \ubc14\ub514 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/atmokpo.com\/w\/38558\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc694\uccad \ubc14\ub514 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"1. FastAPI\ub780? FastAPI\ub294 Python \uae30\ubc18\uc758 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, API\ub97c \ube60\ub974\uace0 \uc27d\uac8c \uad6c\ucd95\ud560 \uc218 \uc788\ub3c4\ub85d \uc124\uacc4\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \ube44\ub3d9\uae30\uc801\uc774\uba70, \ud0c0\uc785 \uc8fc\uc11d(type hint)\uc744 \uc9c0\uc6d0\ud558\uc5ec \uc790\ub3d9\ud654\ub41c \ubb38\uc11c\ud654\uc640 \uc720\ud6a8\uc131 \uac80\uc0ac\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4. FastAPI\ub97c \uc0ac\uc6a9\ud558\uba74 RESTful API\ub97c \ube60\ub974\uac8c \uad6c\ud604\ud560 \uc218 \uc788\uc73c\uba70, \ub192\uc740 \uc131\ub2a5\uc744 \uc790\ub791\ud569\ub2c8\ub2e4. 2. \uc694\uccad \ubc14\ub514\ub780? HTTP \uc694\uccad \ubc14\ub514\ub294 \ud074\ub77c\uc774\uc5b8\ud2b8\uac00 \uc11c\ubc84\uc5d0 \ub370\uc774\ud130\ub97c \uc804\ub2ec\ud560 \ub54c \uc0ac\uc6a9\ud558\ub294 \ubc29\ubc95 \uc911 \ud558\ub098\uc785\ub2c8\ub2e4. \uc8fc\ub85c POST, PUT, PATCH \ub4f1\uc758 &hellip; \ub354 \ubcf4\uae30 &quot;FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc694\uccad \ubc14\ub514&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/38558\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T18:18:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-26T06:44:00+00:00\" \/>\n<meta name=\"author\" content=\"root\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:site\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"root\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"1\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/atmokpo.com\/w\/38558\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38558\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc694\uccad \ubc14\ub514\",\"datePublished\":\"2024-11-01T18:18:16+00:00\",\"dateModified\":\"2024-11-26T06:44:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38558\/\"},\"wordCount\":73,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"FastAPI\uc11c\ubc84\uac1c\ubc1c\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/38558\/\",\"url\":\"https:\/\/atmokpo.com\/w\/38558\/\",\"name\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc694\uccad \ubc14\ub514 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T18:18:16+00:00\",\"dateModified\":\"2024-11-26T06:44:00+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38558\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/38558\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/38558\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc694\uccad \ubc14\ub514\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/atmokpo.com\/w\/#website\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/atmokpo.com\/w\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"contentUrl\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"width\":400,\"height\":400,\"caption\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\"},\"image\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/bebubo4\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\",\"name\":\"root\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"caption\":\"root\"},\"sameAs\":[\"http:\/\/atmokpo.com\/w\"],\"url\":\"https:\/\/atmokpo.com\/w\/author\/root\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc694\uccad \ubc14\ub514 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/atmokpo.com\/w\/38558\/","og_locale":"ko_KR","og_type":"article","og_title":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc694\uccad \ubc14\ub514 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"1. FastAPI\ub780? FastAPI\ub294 Python \uae30\ubc18\uc758 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, API\ub97c \ube60\ub974\uace0 \uc27d\uac8c \uad6c\ucd95\ud560 \uc218 \uc788\ub3c4\ub85d \uc124\uacc4\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \ube44\ub3d9\uae30\uc801\uc774\uba70, \ud0c0\uc785 \uc8fc\uc11d(type hint)\uc744 \uc9c0\uc6d0\ud558\uc5ec \uc790\ub3d9\ud654\ub41c \ubb38\uc11c\ud654\uc640 \uc720\ud6a8\uc131 \uac80\uc0ac\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4. FastAPI\ub97c \uc0ac\uc6a9\ud558\uba74 RESTful API\ub97c \ube60\ub974\uac8c \uad6c\ud604\ud560 \uc218 \uc788\uc73c\uba70, \ub192\uc740 \uc131\ub2a5\uc744 \uc790\ub791\ud569\ub2c8\ub2e4. 2. \uc694\uccad \ubc14\ub514\ub780? HTTP \uc694\uccad \ubc14\ub514\ub294 \ud074\ub77c\uc774\uc5b8\ud2b8\uac00 \uc11c\ubc84\uc5d0 \ub370\uc774\ud130\ub97c \uc804\ub2ec\ud560 \ub54c \uc0ac\uc6a9\ud558\ub294 \ubc29\ubc95 \uc911 \ud558\ub098\uc785\ub2c8\ub2e4. \uc8fc\ub85c POST, PUT, PATCH \ub4f1\uc758 &hellip; \ub354 \ubcf4\uae30 \"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc694\uccad \ubc14\ub514\"","og_url":"https:\/\/atmokpo.com\/w\/38558\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T18:18:16+00:00","article_modified_time":"2024-11-26T06:44:00+00:00","author":"root","twitter_card":"summary_large_image","twitter_creator":"@bebubo4","twitter_site":"@bebubo4","twitter_misc":{"\uae00\uc4f4\uc774":"root","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"1\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/atmokpo.com\/w\/38558\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/38558\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc694\uccad \ubc14\ub514","datePublished":"2024-11-01T18:18:16+00:00","dateModified":"2024-11-26T06:44:00+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/38558\/"},"wordCount":73,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["FastAPI\uc11c\ubc84\uac1c\ubc1c"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/38558\/","url":"https:\/\/atmokpo.com\/w\/38558\/","name":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc694\uccad \ubc14\ub514 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T18:18:16+00:00","dateModified":"2024-11-26T06:44:00+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/38558\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/38558\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/38558\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc694\uccad \ubc14\ub514"}]},{"@type":"WebSite","@id":"https:\/\/atmokpo.com\/w\/#website","url":"https:\/\/atmokpo.com\/w\/","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","description":"","publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/atmokpo.com\/w\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/atmokpo.com\/w\/#organization","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","url":"https:\/\/atmokpo.com\/w\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/","url":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","contentUrl":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","width":400,"height":400,"caption":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8"},"image":{"@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/bebubo4"]},{"@type":"Person","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7","name":"root","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","caption":"root"},"sameAs":["http:\/\/atmokpo.com\/w"],"url":"https:\/\/atmokpo.com\/w\/author\/root\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38558","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/comments?post=38558"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38558\/revisions"}],"predecessor-version":[{"id":38559,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38558\/revisions\/38559"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=38558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=38558"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=38558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}