MCPcopy Index your code
hub / github.com/fastapi/fastapi / write

Method write

fastapi/datastructures.py:66–84  ·  view source on GitHub ↗

Write some bytes to the file. You normally wouldn't use this from a file you read in a request. To be awaitable, compatible with async, this is run in threadpool.

(
        self,
        data: Annotated[
            bytes,
            Doc(
                """
                The bytes to write to the file.
                """
            ),
        ],
    )

Source from the content-addressed store, hash-verified

64 ]
65
66 async def write(
67 self,
68 data: Annotated[
69 bytes,
70 Doc(
71 """
72 The bytes to write to the file.
73 """
74 ),
75 ],
76 ) -> None:
77 """
78 Write some bytes to the file.
79
80 You normally wouldn't use this from a file you read in a request.
81
82 To be awaitable, compatible with async, this is run in threadpool.
83 """
84 return await super().write(data)
85
86 async def read(
87 self,

Callers 5

test_upload_fileFunction · 0.95
write_logFunction · 0.80
write_logFunction · 0.80
write_notificationFunction · 0.80
shutdown_eventFunction · 0.80

Calls

no outgoing calls

Tested by 1

test_upload_fileFunction · 0.76