Browse Source

๐ŸŒ Add Korean translation for `docs/tutorial/request-forms-and-files.md` (#3744)

Co-authored-by: weekwith.me <[email protected]>
pull/4272/head
Nina Hwang 3 years ago
committed by GitHub
parent
commit
062efcbb5d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 35
      docs/ko/docs/tutorial/request-forms-and-files.md
  2. 1
      docs/ko/mkdocs.yml

35
docs/ko/docs/tutorial/request-forms-and-files.md

@ -0,0 +1,35 @@
# ํผ ๋ฐ ํŒŒ์ผ ์š”์ฒญ
`File` ๊ณผ `Form` ์„ ์‚ฌ์šฉํ•˜์—ฌ ํŒŒ์ผ๊ณผ ํผ์„ ํ•จ๊ป˜ ์ •์˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
!!! info "์ •๋ณด"
ํŒŒ์ผ๊ณผ ํผ ๋ฐ์ดํ„ฐ๋ฅผ ํ•จ๊ป˜, ๋˜๋Š” ๊ฐ๊ฐ ์—…๋กœ๋“œํ•˜๊ธฐ ์œ„ํ•ด ๋จผ์ € <a href="https://andrew-d.github.io/python-multipart/" class="external-link" target="_blank">`python-multipart`</a>๋ฅผ ์„ค์น˜ํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค.
์˜ˆ ) `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`์„ ํ•จ๊ป˜ ์‚ฌ์šฉํ•˜๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.

1
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

Loadingโ€ฆ
Cancel
Save