{"id":38572,"date":"2024-11-01T18:18:21","date_gmt":"2024-11-01T18:18:21","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=38572"},"modified":"2024-11-26T06:43:57","modified_gmt":"2024-11-26T06:43:57","slug":"fastapi-%ec%84%9c%eb%b2%84%ea%b0%9c%eb%b0%9c-fastapi-%ed%85%8c%ec%8a%a4%ed%8a%b8-%ed%81%b4%eb%9d%bc%ec%9d%b4%ec%96%b8%ed%8a%b8%eb%a1%9c-api-%ed%85%8c%ec%8a%a4%ed%8a%b8%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/38572\/","title":{"rendered":"FastAPI \uc11c\ubc84\uac1c\ubc1c, FastAPI \ud14c\uc2a4\ud2b8 \ud074\ub77c\uc774\uc5b8\ud2b8\ub85c API \ud14c\uc2a4\ud2b8\ud558\uae30"},"content":{"rendered":"<p>return item<\/p>\n<p>@app.get(&#8220;\/items\/&#8221;, response_model=List[Item])<br \/>\nasync def read_items():<br \/>\n    return list(items.values())<\/p>\n<p>@app.get(&#8220;\/items\/{item_name}&#8221;, response_model=Item)<br \/>\nasync def read_item(item_name: str):<br \/>\n    if item_name in items:<br \/>\n        return items[item_name]<br \/>\n    return {&#8220;error&#8221;: &#8220;Item not found&#8221;}<\/p>\n<p>@app.put(&#8220;\/items\/{item_name}&#8221;, response_model=Item)<br \/>\nasync def update_item(item_name: str, item: Item):<br \/>\n    if item_name in items:<br \/>\n        items[item_name] = item<br \/>\n        return item<br \/>\n    return {&#8220;error&#8221;: &#8220;Item not found&#8221;}<\/p>\n<p>@app.delete(&#8220;\/items\/{item_name}&#8221;, response_model=Item)<br \/>\nasync def delete_item(item_name: str):<br \/>\n    if item_name in items:<br \/>\n        return items.pop(item_name)<br \/>\n    return {&#8220;error&#8221;: &#8220;Item not found&#8221;}<\/p>\n<h4>\ucf54\ub4dc \uc124\uba85<\/h4>\n<p>\uc704\uc758 \ucf54\ub4dc\ub294 Create, Read, Update, Delete \uae30\ub2a5\uc744 \uac16\ucd98 \uc5d4\ub4dc\ud3ec\uc778\ud2b8\ub97c \uc815\uc758\ud569\ub2c8\ub2e4. <strong>POST<\/strong> \uba54\uc11c\ub4dc\ub294 \uc0c8\ub85c\uc6b4 \uc544\uc774\ud15c\uc744 \uc0dd\uc131\ud558\uba70, <strong>GET<\/strong> \uba54\uc11c\ub4dc\ub85c \ubaa8\ub4e0 \uc544\uc774\ud15c\uc744 \uc870\ud68c\ud558\uac70\ub098 \ud2b9\uc815 \uc544\uc774\ud15c\uc744 \uc870\ud68c\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. <strong>PUT<\/strong> \uba54\uc11c\ub4dc\ub294 \uae30\uc874 \uc544\uc774\ud15c\uc744 \uc218\uc815\ud560 \ub54c \uc0ac\uc6a9\ub418\uace0, <strong>DELETE<\/strong> \uba54\uc11c\ub4dc\ub294 \uc544\uc774\ud15c\uc744 \uc0ad\uc81c\ud558\ub294 \uc5ed\ud560\uc744 \ud569\ub2c8\ub2e4.<\/p>\n<h3>3. CRUD API \ud14c\uc2a4\ud2b8\ud558\uae30<\/h3>\n<p>CRUD \uae30\ub2a5\uc744 \ud14c\uc2a4\ud2b8\ud558\ub294 \ud14c\uc2a4\ud2b8 \ucf00\uc774\uc2a4\ub3c4 \ucd94\uac00\ud574\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<pre>\n<code>\ndef test_create_item():\n    response = client.post(\"\/items\/\", json={\"name\": \"Item1\", \"price\": 10.0})\n    assert response.status_code == 200\n    assert response.json() == {\"name\": \"Item1\", \"description\": None, \"price\": 10.0, \"tax\": None}\n\ndef test_read_items():\n    response = client.get(\"\/items\/\")\n    assert response.status_code == 200\n    assert isinstance(response.json(), list)\n\ndef test_update_item():\n    response = client.put(\"\/items\/Item1\", json={\"name\": \"Item1\", \"price\": 12.0})\n    assert response.status_code == 200\n    assert response.json() == {\"name\": \"Item1\", \"description\": None, \"price\": 12.0, \"tax\": None}\n\ndef test_delete_item():\n    response = client.delete(\"\/items\/Item1\")\n    assert response.status_code == 200\n    assert response.json() == {\"name\": \"Item1\", \"description\": None, \"price\": 12.0, \"tax\": None}\n<\/code>\n<\/pre>\n<h4>\ucf54\ub4dc \uc124\uba85<\/h4>\n<p>\uac01 \ud14c\uc2a4\ud2b8 \ud568\uc218\ub294 API\uc758 CRUD \uae30\ub2a5\uc744 \uac80\uc99d\ud569\ub2c8\ub2e4. <strong>test_create_item<\/strong> \ud568\uc218\ub294 \uc0c8\ub85c\uc6b4 \uc544\uc774\ud15c\uc744 \uc0dd\uc131\ud558\uace0, <strong>test_read_items<\/strong> \ud568\uc218\ub294 \ubaa8\ub4e0 \uc544\uc774\ud15c\uc744 \uc870\ud68c\ud569\ub2c8\ub2e4. <strong>test_update_item<\/strong>\uc740 \ud2b9\uc815 \uc544\uc774\ud15c\uc744 \uc218\uc815\ud558\uba70, <strong>test_delete_item<\/strong>\uc740 \uc544\uc774\ud15c\uc744 \uc0ad\uc81c\ud558\ub294 \uae30\ub2a5\uc744 \ud14c\uc2a4\ud2b8\ud569\ub2c8\ub2e4.<\/p>\n<h2>FastAPI\uc758 \ubcf4\uc548\uacfc \uc778\uc99d<\/h2>\n<p>FastAPI\ub294 OAuth2\uc640 JWT \ud1a0\ud070 \uae30\ubc18 \uc778\uc99d\uc744 \uc9c0\uc6d0\ud569\ub2c8\ub2e4. \ubcf4\uc548\uc774 \ud544\uc694\ud55c API \uc5d4\ub4dc\ud3ec\uc778\ud2b8\uc5d0 \ub300\ud55c \uc778\uc99d \ubc29\ubc95\uc744 \uc124\uba85\ud558\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<h3>1. OAuth2PasswordBearer \uc0ac\uc6a9\ud558\uae30<\/h3>\n<pre>\n<code>\nfrom fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm\n\noauth2_scheme = OAuth2PasswordBearer(tokenUrl=\"token\")\n\n@app.post(\"\/token\")\nasync def login(form_data: OAuth2PasswordRequestForm = Depends()):\n    # \uc0ac\uc6a9\uc790 \uc778\uc99d \ub85c\uc9c1 (\uc5ec\uae30\uc11c\ub294 \uc0dd\ub7b5)\n    return {\"access_token\": form_data.username, \"token_type\": \"bearer\"}\n<\/code>\n<\/pre>\n<h3>2. \ubcf4\ud638\ub41c \uc5d4\ub4dc\ud3ec\uc778\ud2b8 \ub9cc\ub4e4\uae30<\/h3>\n<p>\ub85c\uadf8\uc778 \ud6c4 \uc561\uc138\uc2a4 \ud1a0\ud070\uc744 \ud1b5\ud574 \ubcf4\ud638\ub41c \uc5d4\ub4dc\ud3ec\uc778\ud2b8\ub97c \ub9cc\ub4e4\uc5b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<pre>\n<code>\n@app.get(\"\/secure-data\")\nasync def read_secure_data(token: str = Depends(oauth2_scheme)):\n    return {\"data\": \"This is protected data\"}\n<\/code>\n<\/pre>\n<h4>\ucf54\ub4dc \uc124\uba85<\/h4>\n<p>\uc704 \ucf54\ub4dc\ub294 \/token \uacbd\ub85c\uc5d0\uc11c \ub85c\uadf8\uc778 \uc2dc \uc561\uc138\uc2a4 \ud1a0\ud070\uc744 \uc0dd\uc131\ud558\uace0, \uc0dd\uc131\ub41c \ud1a0\ud070\uc744 \ud1b5\ud574 \/secure-data \uacbd\ub85c\uc5d0 \uc811\uadfc\ud558\ub3c4\ub85d \uc124\uc815\ud569\ub2c8\ub2e4. <strong>Depends()<\/strong>\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc778\uc99d\uc774 \ud544\uc694\ud55c \uae30\ub2a5\uc744 \uad6c\ud604\ud588\uc2b5\ub2c8\ub2e4.<\/p>\n<h3>3. \ubcf4\uc548 \ud14c\uc2a4\ud2b8<\/h3>\n<p>\ubcf4\ud638\ub41c \uc5d4\ub4dc\ud3ec\uc778\ud2b8\ub97c \ud14c\uc2a4\ud2b8\ud558\uae30 \uc704\ud574 \uc778\uc99d \ud6c4 \ud1a0\ud070\uc744 \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre>\n<code>\ndef test_secure_data():\n    response = client.post(\"\/token\", data={\"username\": \"testuser\", \"password\": \"testpassword\"})\n    token = response.json().get(\"access_token\")\n\n    response = client.get(\"\/secure-data\", headers={\"Authorization\": f\"Bearer {token}\"})\n    assert response.status_code == 200\n    assert response.json() == {\"data\": \"This is protected data\"}\n<\/code>\n<\/pre>\n<h2>\uacb0\ub860<\/h2>\n<p>\uc774 \ud3ec\uc2a4\ud2b8\uc5d0\uc11c\ub294 FastAPI\ub97c \uc0ac\uc6a9\ud558\uc5ec \uac04\ub2e8\ud55c API \uc11c\ubc84\ub97c \uad6c\ucd95\ud558\uace0, FastAPI\uc758 \ud14c\uc2a4\ud2b8 \ud074\ub77c\uc774\uc5b8\ud2b8\ub97c \ud65c\uc6a9\ud558\uc5ec \ub2e4\uc591\ud55c API \uc5d4\ub4dc\ud3ec\uc778\ud2b8\ub97c \ud14c\uc2a4\ud2b8\ud558\ub294 \ubc29\ubc95\uc5d0 \ub300\ud574 \ubc30\uc6e0\uc2b5\ub2c8\ub2e4. FastAPI\ub97c \ud1b5\ud574 \uace0\uc131\ub2a5\uc758 API\ub97c \uc27d\uac8c \uc0dd\uc131\ud560 \uc218 \uc788\uc73c\uba70, TestClient\ub97c \uc774\uc6a9\ud574 \uc548\uc815\uc801\uc774\uace0 \uc2e0\ub8b0\uc131 \uc788\ub294 \ud14c\uc2a4\ud2b8\ub97c \uc9c4\ud589\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ub2e4\uc591\ud55c \uae30\ub2a5\uacfc \ud655\uc7a5\uc131\uc744 \ubc14\ud0d5\uc73c\ub85c FastAPI\ub97c \ud65c\uc6a9\ud55c \ud504\ub85c\uc81d\ud2b8\ub97c \uc9c4\ud589\ud574\ubcf4\uc2dc\uae38 \ubc14\ub78d\ub2c8\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>return item @app.get(&#8220;\/items\/&#8221;, response_model=List[Item]) async def read_items(): return list(items.values()) @app.get(&#8220;\/items\/{item_name}&#8221;, response_model=Item) async def read_item(item_name: str): if item_name in items: return items[item_name] return {&#8220;error&#8221;: &#8220;Item not found&#8221;} @app.put(&#8220;\/items\/{item_name}&#8221;, response_model=Item) async def update_item(item_name: str, item: Item): if item_name in items: items[item_name] = item return item return {&#8220;error&#8221;: &#8220;Item not found&#8221;} @app.delete(&#8220;\/items\/{item_name}&#8221;, response_model=Item) async def delete_item(item_name: str): if &hellip; <a href=\"https:\/\/atmokpo.com\/w\/38572\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;FastAPI \uc11c\ubc84\uac1c\ubc1c, FastAPI \ud14c\uc2a4\ud2b8 \ud074\ub77c\uc774\uc5b8\ud2b8\ub85c API \ud14c\uc2a4\ud2b8\ud558\uae30&#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-38572","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, FastAPI \ud14c\uc2a4\ud2b8 \ud074\ub77c\uc774\uc5b8\ud2b8\ub85c API \ud14c\uc2a4\ud2b8\ud558\uae30 - \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\/38572\/\" \/>\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, FastAPI \ud14c\uc2a4\ud2b8 \ud074\ub77c\uc774\uc5b8\ud2b8\ub85c API \ud14c\uc2a4\ud2b8\ud558\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"return item @app.get(&#8220;\/items\/&#8221;, response_model=List[Item]) async def read_items(): return list(items.values()) @app.get(&#8220;\/items\/{item_name}&#8221;, response_model=Item) async def read_item(item_name: str): if item_name in items: return items[item_name] return {&#8220;error&#8221;: &#8220;Item not found&#8221;} @app.put(&#8220;\/items\/{item_name}&#8221;, response_model=Item) async def update_item(item_name: str, item: Item): if item_name in items: items[item_name] = item return item return {&#8220;error&#8221;: &#8220;Item not found&#8221;} @app.delete(&#8220;\/items\/{item_name}&#8221;, response_model=Item) async def delete_item(item_name: str): if &hellip; \ub354 \ubcf4\uae30 &quot;FastAPI \uc11c\ubc84\uac1c\ubc1c, FastAPI \ud14c\uc2a4\ud2b8 \ud074\ub77c\uc774\uc5b8\ud2b8\ub85c API \ud14c\uc2a4\ud2b8\ud558\uae30&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/38572\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T18:18:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-26T06:43:57+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=\"2\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/atmokpo.com\/w\/38572\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38572\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, FastAPI \ud14c\uc2a4\ud2b8 \ud074\ub77c\uc774\uc5b8\ud2b8\ub85c API \ud14c\uc2a4\ud2b8\ud558\uae30\",\"datePublished\":\"2024-11-01T18:18:21+00:00\",\"dateModified\":\"2024-11-26T06:43:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38572\/\"},\"wordCount\":155,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"FastAPI\uc11c\ubc84\uac1c\ubc1c\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/38572\/\",\"url\":\"https:\/\/atmokpo.com\/w\/38572\/\",\"name\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, FastAPI \ud14c\uc2a4\ud2b8 \ud074\ub77c\uc774\uc5b8\ud2b8\ub85c API \ud14c\uc2a4\ud2b8\ud558\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T18:18:21+00:00\",\"dateModified\":\"2024-11-26T06:43:57+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38572\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/38572\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/38572\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, FastAPI \ud14c\uc2a4\ud2b8 \ud074\ub77c\uc774\uc5b8\ud2b8\ub85c API \ud14c\uc2a4\ud2b8\ud558\uae30\"}]},{\"@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, FastAPI \ud14c\uc2a4\ud2b8 \ud074\ub77c\uc774\uc5b8\ud2b8\ub85c API \ud14c\uc2a4\ud2b8\ud558\uae30 - \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\/38572\/","og_locale":"ko_KR","og_type":"article","og_title":"FastAPI \uc11c\ubc84\uac1c\ubc1c, FastAPI \ud14c\uc2a4\ud2b8 \ud074\ub77c\uc774\uc5b8\ud2b8\ub85c API \ud14c\uc2a4\ud2b8\ud558\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"return item @app.get(&#8220;\/items\/&#8221;, response_model=List[Item]) async def read_items(): return list(items.values()) @app.get(&#8220;\/items\/{item_name}&#8221;, response_model=Item) async def read_item(item_name: str): if item_name in items: return items[item_name] return {&#8220;error&#8221;: &#8220;Item not found&#8221;} @app.put(&#8220;\/items\/{item_name}&#8221;, response_model=Item) async def update_item(item_name: str, item: Item): if item_name in items: items[item_name] = item return item return {&#8220;error&#8221;: &#8220;Item not found&#8221;} @app.delete(&#8220;\/items\/{item_name}&#8221;, response_model=Item) async def delete_item(item_name: str): if &hellip; \ub354 \ubcf4\uae30 \"FastAPI \uc11c\ubc84\uac1c\ubc1c, FastAPI \ud14c\uc2a4\ud2b8 \ud074\ub77c\uc774\uc5b8\ud2b8\ub85c API \ud14c\uc2a4\ud2b8\ud558\uae30\"","og_url":"https:\/\/atmokpo.com\/w\/38572\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T18:18:21+00:00","article_modified_time":"2024-11-26T06:43:57+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":"2\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/atmokpo.com\/w\/38572\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/38572\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"FastAPI \uc11c\ubc84\uac1c\ubc1c, FastAPI \ud14c\uc2a4\ud2b8 \ud074\ub77c\uc774\uc5b8\ud2b8\ub85c API \ud14c\uc2a4\ud2b8\ud558\uae30","datePublished":"2024-11-01T18:18:21+00:00","dateModified":"2024-11-26T06:43:57+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/38572\/"},"wordCount":155,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["FastAPI\uc11c\ubc84\uac1c\ubc1c"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/38572\/","url":"https:\/\/atmokpo.com\/w\/38572\/","name":"FastAPI \uc11c\ubc84\uac1c\ubc1c, FastAPI \ud14c\uc2a4\ud2b8 \ud074\ub77c\uc774\uc5b8\ud2b8\ub85c API \ud14c\uc2a4\ud2b8\ud558\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T18:18:21+00:00","dateModified":"2024-11-26T06:43:57+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/38572\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/38572\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/38572\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"FastAPI \uc11c\ubc84\uac1c\ubc1c, FastAPI \ud14c\uc2a4\ud2b8 \ud074\ub77c\uc774\uc5b8\ud2b8\ub85c API \ud14c\uc2a4\ud2b8\ud558\uae30"}]},{"@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":[{"id":38578,"url":"https:\/\/atmokpo.com\/w\/38578\/","url_meta":{"origin":38572,"position":0},"title":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \ucee8\ud14c\uc774\ub108 \uc2e4\ud589  App Runner \uc124\uc815 \ubc0f \uc2e4\ud589","author":"root","date":"2024\ub144 11\uc6d4 01\uc77c","format":false,"excerpt":"FastAPI\ub294 \ud604\ub300\uc758 API \uc11c\ubc84 \uac1c\ubc1c\uc5d0 \ucd5c\uc801\ud654\ub41c \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \ube44\ub3d9\uae30 \ud504\ub85c\uadf8\ub798\ubc0d\uc744 \uc9c0\uc6d0\ud558\uba70 \uc790\ub3d9 \ubb38\uc11c\ud654 \uae30\ub2a5\uc774 \ub6f0\uc5b4\ub098\uae30 \ub54c\ubb38\uc5d0 \ub9ce\uc740 \uac1c\ubc1c\uc790\uc640 \uae30\uc5c5\ub4e4\uc774 \uc120\ud0dd\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4. \ubcf8 \uac15\uc88c\uc5d0\uc11c\ub294 FastAPI\ub85c \uac04\ub2e8\ud55c \uc11c\ubc84\ub97c \uad6c\ud604\ud558\uace0, \uc774\ub97c \ucee8\ud14c\uc774\ub108\ud654\ud558\uc5ec AWS App Runner\uc5d0 \ubc30\ud3ec\ud558\ub294 \uacfc\uc815\uc744 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. 1. FastAPI \uc18c\uac1c FastAPI\ub294 Python\uc73c\ub85c \uc791\uc131\ub41c \ube44\ub3d9\uae30 RESTful API \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\uc785\ub2c8\ub2e4. \ub2e4\uc74c\uacfc \uac19\uc740 \uc8fc\uc694 \uae30\ub2a5\uc744\u2026","rel":"","context":"&quot;FastAPI\uc11c\ubc84\uac1c\ubc1c&quot;\uc5d0\uc11c","block_context":{"text":"FastAPI\uc11c\ubc84\uac1c\ubc1c","link":"https:\/\/atmokpo.com\/w\/category\/fastapi%ec%84%9c%eb%b2%84%ea%b0%9c%eb%b0%9c\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":38524,"url":"https:\/\/atmokpo.com\/w\/38524\/","url_meta":{"origin":38572,"position":1},"title":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc131\ub2a5 \ucd5c\uc801\ud654\ub97c \uc704\ud55c \uce90\uc2f1 \ubc0f \ub85c\ub4dc \ubc38\ub7f0\uc2f1 \uc804\ub7b5","author":"root","date":"2024\ub144 11\uc6d4 01\uc77c","format":false,"excerpt":"\uc791\uc131\uc790: \uc870\uad11\ud615 \ubc1c\ud589\uc77c: [\uc624\ub298 \ub0a0\uc9dc] \uc18c\uac1c FastAPI\ub294 Python\uc73c\ub85c \uc791\uc131\ub41c \uace0\uc131\ub2a5 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, \ube60\ub978 \uac1c\ubc1c \uc18d\ub3c4\uc640 \ub192\uc740 \uc131\ub2a5 \ub355\ubd84\uc5d0 \ub9ce\uc740 \uac1c\ubc1c\uc790\ub4e4\uc5d0\uac8c \uc0ac\ub791\ubc1b\uace0 \uc788\uc2b5\ub2c8\ub2e4. \ud558\uc9c0\ub9cc \uc131\ub2a5\uc774 \uc88b\ub2e4\uace0 \ud574\uc11c \ubaa8\ub4e0 \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc774 \uc6d0\ud65c\ud558\uac8c \uc791\ub3d9\ud558\ub294 \uac83\uc740 \uc544\ub2d9\ub2c8\ub2e4. \ud2b9\ud788 \ud2b8\ub798\ud53d\uc774 \ub9ce\uc740 \uc11c\ube44\uc2a4\uc5d0\uc11c\ub294 \uc131\ub2a5 \ucd5c\uc801\ud654\uac00 \ud544\uc218\uc801\uc785\ub2c8\ub2e4. \uc774 \uae00\uc5d0\uc11c\ub294 FastAPI \uc11c\ubc84\uc758 \uc131\ub2a5\uc744 \ucd5c\uc801\ud654\ud558\uae30 \uc704\ud55c \uce90\uc2f1(caching)\uacfc \ub85c\ub4dc \ubc38\ub7f0\uc2f1(load\u2026","rel":"","context":"&quot;FastAPI\uc11c\ubc84\uac1c\ubc1c&quot;\uc5d0\uc11c","block_context":{"text":"FastAPI\uc11c\ubc84\uac1c\ubc1c","link":"https:\/\/atmokpo.com\/w\/category\/fastapi%ec%84%9c%eb%b2%84%ea%b0%9c%eb%b0%9c\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":30973,"url":"https:\/\/atmokpo.com\/w\/30973\/","url_meta":{"origin":38572,"position":2},"title":"UWP \uac1c\ubc1c, ItemsControl \uc694\uc18c\ub97c \ud65c\uc6a9\ud55c XAML \uc694\uc18c\uc758 \uc0dd\uc131","author":"root","date":"2024\ub144 10\uc6d4 28\uc77c","format":false,"excerpt":"\uc800\uc790: \uc870\uad11\ud615 \ub0a0\uc9dc: [\ubc1c\ud589 \ub0a0\uc9dc] \ubaa9\ucc28 1. \uc11c\ub860 2. ItemsControl \uc774\ud574\ud558\uae30 3. ItemsControl \uc0dd\uc131\ud558\uae30 4. \ub370\uc774\ud130 \ubc14\uc778\ub529 \uc801\uc6a9\ud558\uae30 5. \ud56d\ubaa9 \ucee4\uc2a4\ud130\ub9c8\uc774\uc9d5\ud558\uae30 6. \uacb0\ub860 7. \ucc38\uace0\ubb38\ud5cc 1. \uc11c\ub860 UWP(Universal Windows Platform) \uac1c\ubc1c\uc740 \ub2e4\uc591\ud55c \ub514\ubc14\uc774\uc2a4\uc5d0\uc11c \uc791\ub3d9\ud558\ub294 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uc791\uc131\ud560 \uc218 \uc788\ub3c4\ub85d \ub3d5\ub294 \ud50c\ub7ab\ud3fc\uc785\ub2c8\ub2e4. XAML(Extensible Application Markup Language)\uc740 UWP \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc758 UI\ub97c \uc815\uc758\ud558\ub294 \ub370 \uc0ac\uc6a9\ub418\ub294\u2026","rel":"","context":"&quot;UWP \uac1c\ubc1c&quot;\uc5d0\uc11c","block_context":{"text":"UWP \uac1c\ubc1c","link":"https:\/\/atmokpo.com\/w\/category\/uwp-%ea%b0%9c%eb%b0%9c\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":38432,"url":"https:\/\/atmokpo.com\/w\/38432\/","url_meta":{"origin":38572,"position":3},"title":"FastAPI \uc11c\ubc84\uac1c\ubc1c, \uc774\ubca4\ud2b8 \ubb38\uc11c \ud074\ub798\uc2a4\uc640 \ub77c\uc6b0\ud2b8 \ubcc0\uacbd","author":"root","date":"2024\ub144 11\uc6d4 01\uc77c","format":false,"excerpt":"\uc791\uc131\uc790: \uc870\uad11\ud615 \ub0a0\uc9dc: 2024\ub144 11\uc6d4 26\uc77c 1. FastAPI\ub780? FastAPI\ub294 Python\uc758 \ube44\ub3d9\uae30 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, API \uc11c\ubc84\ub97c \uac1c\ubc1c\ud558\ub294 \ub370 \ucd5c\uc801\ud654\ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4. Python\uc758 \ud0c0\uc785 \ud78c\ud2b8\ub97c \ud65c\uc6a9\ud558\uc5ec \uac15\ub825\ud55c \ub370\uc774\ud130 \uac80\uc99d \ubc0f \ubb38\uc11c\ud654 \uae30\ub2a5\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4. FastAPI\ub294 \uc2a4\ud0c0\ud2b8\uc5c5\uc5d0\uc11c \ub300\uaddc\ubaa8 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0 \uc774\ub974\uae30\uae4c\uc9c0 \ub2e4\uc591\ud55c \ud504\ub85c\uc81d\ud2b8\uc5d0 \uc801\ud569\ud558\uba70, OpenAPI\uc640 JSON Schema\ub97c \uc9c0\uc6d0\ud558\uc5ec \uc790\ub3d9\uc73c\ub85c API \ubb38\uc11c\ub97c \uc0dd\uc131\ud569\ub2c8\ub2e4. \uc774\ub7ec\ud55c \ud2b9\uc9d5 \ub355\ubd84\uc5d0 FastAPI\ub294\u2026","rel":"","context":"&quot;FastAPI\uc11c\ubc84\uac1c\ubc1c&quot;\uc5d0\uc11c","block_context":{"text":"FastAPI\uc11c\ubc84\uac1c\ubc1c","link":"https:\/\/atmokpo.com\/w\/category\/fastapi%ec%84%9c%eb%b2%84%ea%b0%9c%eb%b0%9c\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":43444,"url":"https:\/\/atmokpo.com\/w\/43444\/","url_meta":{"origin":38572,"position":4},"title":"[\uc544\ud30c\uce58 \ucf54\ub974\ub3c4\ubc14]  JavaScript\uc640 \uc624\ud504\ub77c\uc778 \uae30\ub2a5","author":"root","date":"2024\ub144 11\uc6d4 27\uc77c","format":false,"excerpt":"\ub2e4\uc591\ud55c \ubaa8\ubc14\uc77c \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c \uc624\ud504\ub77c\uc778 \uae30\ub2a5\uc740 \ud544\uc218 \ubd88\uac00\uacb0\ud55c \uc694\uc18c\ub85c \uc790\ub9ac \uc7a1\uace0 \uc788\uc2b5\ub2c8\ub2e4. \uc544\ud30c\uce58 \ucf54\ub974\ub3c4\ubc14\ub294 HTML5, CSS, JavaScript\ub97c \uc0ac\uc6a9\ud558\uc5ec \ubaa8\ubc14\uc77c \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uac1c\ubc1c\ud560 \uc218 \uc788\ub294 \ud50c\ub7ab\ud3fc\uc73c\ub85c, \uc774\ub7ec\ud55c \uae30\ub2a5\uc744 \uc9c0\uc6d0\ud569\ub2c8\ub2e4. \uc774 \uae00\uc5d0\uc11c\ub294 JavaScript\ub97c \ud1b5\ud574 \uc544\ud30c\uce58 \ucf54\ub974\ub3c4\ubc14\ub97c \ud65c\uc6a9\ud558\uc5ec \uc624\ud504\ub77c\uc778 \uae30\ub2a5\uc744 \uc5b4\ub5bb\uac8c \uad6c\ud604\ud560 \uc218 \uc788\ub294\uc9c0\ub97c \uc2ec\ub3c4 \uc788\uac8c \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. 1. \uc624\ud504\ub77c\uc778 \uae30\ub2a5\uc758 \uc911\uc694\uc131 \ubaa8\ubc14\uc77c \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c \uc624\ud504\ub77c\uc778 \uae30\ub2a5\uc740\u2026","rel":"","context":"&quot;cordova&quot;\uc5d0\uc11c","block_context":{"text":"cordova","link":"https:\/\/atmokpo.com\/w\/category\/cordova\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":43517,"url":"https:\/\/atmokpo.com\/w\/43517\/","url_meta":{"origin":38572,"position":5},"title":"[Dart \uc5b8\uc5b4\uac15\uc88c]  025. Dart \ucf54\ub4dc\uc758 \uc131\ub2a5 \ucd5c\uc801\ud654, \uba54\ubaa8\ub9ac \uad00\ub9ac \ubc0f \uc131\ub2a5 \uac1c\uc120 \uae30\ubc95","author":"root","date":"2024\ub144 11\uc6d4 28\uc77c","format":false,"excerpt":"\uc791\uc131\uc790: \uc870\uad11\ud615 | \ub0a0\uc9dc: [\ub0a0\uc9dc] 1. \uc18c\uac1c Dart\ub294 Google\uc5d0\uc11c \uac1c\ubc1c\ud55c \ud504\ub85c\uadf8\ub798\ubc0d \uc5b8\uc5b4\ub85c, \ud2b9\ud788 \ubaa8\ubc14\uc77c, \uc6f9 \ubc0f \uc11c\ubc84 \uce21 \uac1c\ubc1c\uc5d0 \ub9ce\uc774 \uc0ac\uc6a9\ub429\ub2c8\ub2e4. Dart\uc758 \uc131\ub2a5\uc744 \uadf9\ub300\ud654\ud558\uae30 \uc704\ud574\uc11c\ub294 \ucf54\ub4dc \ucd5c\uc801\ud654, \uba54\ubaa8\ub9ac \uad00\ub9ac \ubc0f \uc804\ubc18\uc801\uc778 \uc131\ub2a5 \uac1c\uc120 \uae30\ubc95\uc744 \uc774\ud574\ud558\ub294 \uac83\uc774 \uc911\uc694\ud569\ub2c8\ub2e4. \uc774 \uae00\uc5d0\uc11c\ub294 Dart \ucf54\ub4dc\uc758 \uc131\ub2a5 \ucd5c\uc801\ud654\uc640 \ud6a8\uc728\uc801\uc778 \uba54\ubaa8\ub9ac \uad00\ub9ac\ub97c \uc704\ud55c \ub2e4\uc591\ud55c \uae30\ubc95\uc744 \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.\u2026","rel":"","context":"&quot;\ud50c\ub7ec\ud130 \uac15\uc88c&quot;\uc5d0\uc11c","block_context":{"text":"\ud50c\ub7ec\ud130 \uac15\uc88c","link":"https:\/\/atmokpo.com\/w\/category\/%ed%94%8c%eb%9f%ac%ed%84%b0-%ea%b0%95%ec%a2%8c\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38572","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=38572"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38572\/revisions"}],"predecessor-version":[{"id":38573,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38572\/revisions\/38573"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=38572"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=38572"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=38572"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}