Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 71 for sizeof (0.22 sec)

  1. docs_src/request_files/tutorial002_py39.py

    from fastapi import FastAPI, File, UploadFile
    from fastapi.responses import HTMLResponse
    
    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_files(files: list[bytes] = File()):
        return {"file_sizes": [len(file) for file in files]}
    
    
    @app.post("/uploadfiles/")
    async def create_upload_files(files: list[UploadFile]):
        return {"filenames": [file.filename for file in files]}
    
    
    @app.get("/")
    async def main():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 786 bytes
    - Viewed (0)
  2. docs_src/request_files/tutorial003_py39.py

    from fastapi.responses import HTMLResponse
    
    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_files(
        files: list[bytes] = File(description="Multiple files as bytes"),
    ):
        return {"file_sizes": [len(file) for file in files]}
    
    
    @app.post("/uploadfiles/")
    async def create_upload_files(
        files: list[UploadFile] = File(description="Multiple files as UploadFile"),
    ):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 888 bytes
    - Viewed (0)
  3. tests/test_tutorial/test_request_files/test_tutorial003.py

                    ("files", ("test.txt", file)),
                    ("files", ("test2.txt", file2)),
                ),
            )
        assert response.status_code == 200, response.text
        assert response.json() == {"file_sizes": [14, 15]}
    
    
    def test_post_upload_file(tmp_path):
        path = tmp_path / "test.txt"
        path.write_bytes(b"<file content>")
        path2 = tmp_path / "test2.txt"
        path2.write_bytes(b"<file content2>")
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 7.1K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_request_files/test_tutorial002.py

                    ("files", ("test.txt", file)),
                    ("files", ("test2.txt", file2)),
                ),
            )
        assert response.status_code == 200, response.text
        assert response.json() == {"file_sizes": [14, 15]}
    
    
    def test_post_upload_file(tmp_path):
        path = tmp_path / "test.txt"
        path.write_bytes(b"<file content>")
        path2 = tmp_path / "test2.txt"
        path2.write_bytes(b"<file content2>")
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 8.5K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_request_files/test_tutorial003_py39.py

                    ("files", ("test.txt", file)),
                    ("files", ("test2.txt", file2)),
                ),
            )
        assert response.status_code == 200, response.text
        assert response.json() == {"file_sizes": [14, 15]}
    
    
    @needs_py39
    def test_post_upload_file(tmp_path, app: FastAPI):
        path = tmp_path / "test.txt"
        path.write_bytes(b"<file content>")
        path2 = tmp_path / "test2.txt"
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 7.6K bytes
    - Viewed (0)
  6. docs_src/additional_status_codes/tutorial001_an.py

    items = {"foo": {"name": "Fighters", "size": 6}, "bar": {"name": "Tenders", "size": 3}}
    
    
    @app.put("/items/{item_id}")
    async def upsert_item(
        item_id: str,
        name: Annotated[Union[str, None], Body()] = None,
        size: Annotated[Union[int, None], Body()] = None,
    ):
        if item_id in items:
            item = items[item_id]
            item["name"] = name
            item["size"] = size
            return item
        else:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 734 bytes
    - Viewed (0)
  7. tests/test_tutorial/test_extra_models/test_tutorial003.py

                    "PlaneItem": {
                        "title": "PlaneItem",
                        "required": IsOneOf(
                            ["description", "type", "size"],
                            # TODO: remove when deprecating Pydantic v1
                            ["description", "size"],
                        ),
                        "type": "object",
                        "properties": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Aug 04 20:47:07 GMT 2023
    - 5.1K bytes
    - Viewed (0)
  8. docs/en/docs/img/deployment/https/https04.drawio

                    </mxCell>
                    <mxCell id="101" value="&lt;span style=&quot;font-family: &amp;#34;roboto&amp;#34; ; font-size: 24px&quot;&gt;IP:&lt;/span&gt;&lt;br style=&quot;font-family: &amp;#34;roboto&amp;#34;&quot;&gt;&lt;span style=&quot;font-family: &amp;#34;roboto&amp;#34; ; font-size: 24px&quot;&gt;123.124.125.126&lt;/span&gt;" style="shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;strokeWidth=3;" parent="1" vertex="1">
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu May 12 00:06:16 GMT 2022
    - 14K bytes
    - Viewed (0)
  9. docs/en/docs/img/deployment/https/https02.drawio

                    <mxCell id="42" value="&lt;font face=&quot;Roboto&quot; data-font-src=&quot;https://fonts.googleapis.com/css?family=Roboto&quot;&gt;&lt;span style=&quot;font-size: 24px&quot;&gt;IP:&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;font-size: 24px&quot;&gt;123.124.125.126&lt;/span&gt;&lt;br&gt;&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=#000000;strokeWidth=3;" parent="1" vertex="1">
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu May 12 00:06:16 GMT 2022
    - 9.4K bytes
    - Viewed (0)
  10. docs/en/docs/img/deployment/concepts/process-ram.drawio

                    </mxCell>
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu May 12 00:06:16 GMT 2022
    - 10K bytes
    - Viewed (0)
Back to top