From eb79441a7f23c0df42f13547af67159d037f43c5 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 9 Dec 2021 10:40:14 +0000 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index ca7553855..053244434 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 🌐 Add portuguese translation for `docs/tutorial/query-params-str-validations.md`. PR [#3965](https://github.com/tiangolo/fastapi/pull/3965) by [@leandrodesouzadev](https://github.com/leandrodesouzadev). * 🌐 Add Korean translation for `docs/tutorial/response-status-code.md`. PR [#3742](https://github.com/tiangolo/fastapi/pull/3742) by [@NinaHwang](https://github.com/NinaHwang). * 🌐 Add Korean translation for Tutorial - JSON Compatible Encoder. PR [#3152](https://github.com/tiangolo/fastapi/pull/3152) by [@NEONKID](https://github.com/NEONKID). * 🌐 Add Korean translation for Tutorial - Path Parameters and Numeric Validations. PR [#2432](https://github.com/tiangolo/fastapi/pull/2432) by [@hard-coders](https://github.com/hard-coders). From aa4a69f790fb9a78ba7ed7767273f8734a5d028d Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 9 Dec 2021 10:45:00 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 053244434..b96e81c76 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 🌐 Add Korean translation for `docs/tutorial/request-files.md`. PR [#3743](https://github.com/tiangolo/fastapi/pull/3743) by [@NinaHwang](https://github.com/NinaHwang). * 🌐 Add portuguese translation for `docs/tutorial/query-params-str-validations.md`. PR [#3965](https://github.com/tiangolo/fastapi/pull/3965) by [@leandrodesouzadev](https://github.com/leandrodesouzadev). * 🌐 Add Korean translation for `docs/tutorial/response-status-code.md`. PR [#3742](https://github.com/tiangolo/fastapi/pull/3742) by [@NinaHwang](https://github.com/NinaHwang). * 🌐 Add Korean translation for Tutorial - JSON Compatible Encoder. PR [#3152](https://github.com/tiangolo/fastapi/pull/3152) by [@NEONKID](https://github.com/NEONKID). From 062efcbb5d19efb075ed1b50cb3f01d813c04460 Mon Sep 17 00:00:00 2001 From: Nina Hwang <79563565+NinaHwang@users.noreply.github.com> Date: Thu, 9 Dec 2021 19:47:26 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=8C=90=20Add=20Korean=20translation?= =?UTF-8?q?=20for=20`docs/tutorial/request-forms-and-files.md`=20(#3744)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: weekwith.me <63915557+0417taehyun@users.noreply.github.com> --- .../docs/tutorial/request-forms-and-files.md | 35 +++++++++++++++++++ docs/ko/mkdocs.yml | 1 + 2 files changed, 36 insertions(+) create mode 100644 docs/ko/docs/tutorial/request-forms-and-files.md diff --git a/docs/ko/docs/tutorial/request-forms-and-files.md b/docs/ko/docs/tutorial/request-forms-and-files.md new file mode 100644 index 000000000..6750c7b23 --- /dev/null +++ b/docs/ko/docs/tutorial/request-forms-and-files.md @@ -0,0 +1,35 @@ +# 폼 및 파일 μš”μ²­ + +`File` κ³Ό `Form` 을 μ‚¬μš©ν•˜μ—¬ 파일과 폼을 ν•¨κ»˜ μ •μ˜ν•  수 μžˆμŠ΅λ‹ˆλ‹€. + +!!! info "정보" + 파일과 폼 데이터λ₯Ό ν•¨κ»˜, λ˜λŠ” 각각 μ—…λ‘œλ“œν•˜κΈ° μœ„ν•΄ λ¨Όμ € `python-multipart`λ₯Ό μ„€μΉ˜ν•΄μ•Όν•©λ‹ˆλ‹€. + + 예 ) `pip install python-multipart`. + +## `File` 및 `Form` μ—…λ‘œλ“œ + +```Python hl_lines="1" +{!../../../docs_src/request_forms_and_files/tutorial001.py!} +``` + +## `File` 및 `Form` λ§€κ°œλ³€μˆ˜ μ •μ˜ + +`Body` 및 `Query`와 λ™μΌν•œ λ°©μ‹μœΌλ‘œ 파일과 폼의 λ§€κ°œλ³€μˆ˜λ₯Ό μƒμ„±ν•©λ‹ˆλ‹€: + +```Python hl_lines="8" +{!../../../docs_src/request_forms_and_files/tutorial001.py!} +``` + +파일과 폼 ν•„λ“œλŠ” 폼 데이터 ν˜•μ‹μœΌλ‘œ μ—…λ‘œλ“œλ˜μ–΄ 파일과 폼 ν•„λ“œλ‘œ μ „λ‹¬λ©λ‹ˆλ‹€. + +μ–΄λ–€ νŒŒμΌλ“€μ€ `bytes`둜, 또 μ–΄λ–€ νŒŒμΌλ“€μ€ `UploadFile`둜 μ„ μ–Έν•  수 μžˆμŠ΅λ‹ˆλ‹€. + +!!! warning "주의" + λ‹€μˆ˜μ˜ `File`κ³Ό `Form` λ§€κ°œλ³€μˆ˜λ₯Ό ν•œ *경둜 μž‘λ™*에 μ„ μ–Έν•˜λŠ” 것이 κ°€λŠ₯ν•˜μ§€λ§Œ, μš”μ²­μ˜ 본문이 `application/json`κ°€ μ•„λ‹Œ `multipart/form-data`둜 인코딩 되기 λ•Œλ¬Έμ— JSON으둜 λ°›μ•„μ•Όν•˜λŠ” `Body` ν•„λ“œλ₯Ό ν•¨κ»˜ μ„ μ–Έν•  μˆ˜λŠ” μ—†μŠ΅λ‹ˆλ‹€. + + μ΄λŠ” **FastAPI**의 ν•œκ³„κ°€ μ•„λ‹ˆλΌ, HTTP ν”„λ‘œν† μ½œμ— μ˜ν•œ κ²ƒμž…λ‹ˆλ‹€. + +## μš”μ•½ + +ν•˜λ‚˜μ˜ μš”μ²­μœΌλ‘œ 데이터와 νŒŒμΌλ“€μ„ λ°›μ•„μ•Ό ν•  경우 `File`κ³Ό `Form`을 ν•¨κ»˜ μ‚¬μš©ν•˜κΈ° λ°”λžλ‹ˆλ‹€. diff --git a/docs/ko/mkdocs.yml b/docs/ko/mkdocs.yml index 124e7b1d3..7a75940a3 100644 --- a/docs/ko/mkdocs.yml +++ b/docs/ko/mkdocs.yml @@ -64,6 +64,7 @@ nav: - tutorial/path-params-numeric-validations.md - tutorial/response-status-code.md - tutorial/request-files.md + - tutorial/request-forms-and-files.md markdown_extensions: - toc: permalink: true From 0a87bc88b85445018d3ced9d07ac6a37f9e6d8f1 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 9 Dec 2021 10:48:10 +0000 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index b96e81c76..271aab5d1 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 🌐 Add Korean translation for `docs/tutorial/request-forms-and-files.md`. PR [#3744](https://github.com/tiangolo/fastapi/pull/3744) by [@NinaHwang](https://github.com/NinaHwang). * 🌐 Add Korean translation for `docs/tutorial/request-files.md`. PR [#3743](https://github.com/tiangolo/fastapi/pull/3743) by [@NinaHwang](https://github.com/NinaHwang). * 🌐 Add portuguese translation for `docs/tutorial/query-params-str-validations.md`. PR [#3965](https://github.com/tiangolo/fastapi/pull/3965) by [@leandrodesouzadev](https://github.com/leandrodesouzadev). * 🌐 Add Korean translation for `docs/tutorial/response-status-code.md`. PR [#3742](https://github.com/tiangolo/fastapi/pull/3742) by [@NinaHwang](https://github.com/NinaHwang).