You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/de/docs/tutorial/request-files.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ Importieren Sie `File` und `UploadFile` von `fastapi`:
27
27
28
28
=== "Python 3.8+ nicht annotiert"
29
29
30
-
!!! tip
30
+
!!! tip "Tipp"
31
31
Bevorzugen Sie die `Annotated`-Version, falls möglich.
32
32
33
33
```Python hl_lines="1"
@@ -52,7 +52,7 @@ Erstellen Sie Datei-Parameter, so wie Sie es auch mit `Body` und `Form` machen w
52
52
53
53
=== "Python 3.8+ nicht annotiert"
54
54
55
-
!!! tip
55
+
!!! tip "Tipp"
56
56
Bevorzugen Sie die `Annotated`-Version, falls möglich.
57
57
58
58
```Python hl_lines="7"
@@ -64,7 +64,7 @@ Erstellen Sie Datei-Parameter, so wie Sie es auch mit `Body` und `Form` machen w
64
64
65
65
Aber erinnern Sie sich, dass, wenn Sie `Query`, `Path`, `File` und andere von `fastapi` importieren, diese tatsächlich Funktionen sind, welche spezielle Klassen zurückgeben
66
66
67
-
!!! tip
67
+
!!! tip "Tipp"
68
68
Um Datei-Bodys zu deklarieren, müssen Sie `File` verwenden, da diese Parameter sonst als Query-Parameter oder Body(-JSON)-Parameter interpretiert werden würden.
69
69
70
70
Die Dateien werden als "Formulardaten" hochgeladen.
@@ -93,7 +93,7 @@ Definieren Sie einen Datei-Parameter mit dem Typ `UploadFile`:
93
93
94
94
=== "Python 3.8+ nicht annotiert"
95
95
96
-
!!! tip
96
+
!!! tip "Tipp"
97
97
Bevorzugen Sie die `Annotated`-Version, falls möglich.
98
98
99
99
```Python hl_lines="12"
@@ -189,7 +189,7 @@ Sie können eine Datei optional machen, indem Sie Standard Typ-Annotationen verw
189
189
190
190
=== "Python 3.10+ nicht annotiert"
191
191
192
-
!!! tip
192
+
!!! tip "Tipp"
193
193
Bevorzugen Sie die `Annotated`-Version, falls möglich.
194
194
195
195
```Python hl_lines="7 15"
@@ -198,7 +198,7 @@ Sie können eine Datei optional machen, indem Sie Standard Typ-Annotationen verw
198
198
199
199
=== "Python 3.8+ nicht annotiert"
200
200
201
-
!!! tip
201
+
!!! tip "Tipp"
202
202
Bevorzugen Sie die `Annotated`-Version, falls möglich.
203
203
204
204
```Python hl_lines="9 17"
@@ -223,7 +223,7 @@ Sie können auch `File()` zusammen mit `UploadFile` verwenden, um zum Beispiel z
223
223
224
224
=== "Python 3.8+ nicht annotiert"
225
225
226
-
!!! tip
226
+
!!! tip "Tipp"
227
227
Bevorzugen Sie die `Annotated`-Version, falls möglich.
228
228
229
229
```Python hl_lines="7 13"
@@ -252,7 +252,7 @@ Um das zu machen, deklarieren Sie eine Liste von `bytes` oder `UploadFile`s:
252
252
253
253
=== "Python 3.9+ nicht annotiert"
254
254
255
-
!!! tip
255
+
!!! tip "Tipp"
256
256
Bevorzugen Sie die `Annotated`-Version, falls möglich.
257
257
258
258
```Python hl_lines="8 13"
@@ -261,7 +261,7 @@ Um das zu machen, deklarieren Sie eine Liste von `bytes` oder `UploadFile`s:
261
261
262
262
=== "Python 3.8+ nicht annotiert"
263
263
264
-
!!! tip
264
+
!!! tip "Tipp"
265
265
Bevorzugen Sie die `Annotated`-Version, falls möglich.
266
266
267
267
```Python hl_lines="10 15"
@@ -293,7 +293,7 @@ Und so wie zuvor können Sie `File()` verwenden, um zusätzliche Parameter zu se
293
293
294
294
=== "Python 3.9+ nicht annotiert"
295
295
296
-
!!! tip
296
+
!!! tip "Tipp"
297
297
Bevorzugen Sie die `Annotated`-Version, falls möglich.
298
298
299
299
```Python hl_lines="9 16"
@@ -302,7 +302,7 @@ Und so wie zuvor können Sie `File()` verwenden, um zusätzliche Parameter zu se
302
302
303
303
=== "Python 3.8+ nicht annotiert"
304
304
305
-
!!! tip
305
+
!!! tip "Tipp"
306
306
Bevorzugen Sie die `Annotated`-Version, falls möglich.
0 commit comments