Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 1,307 for posAt (0.04 sec)

  1. tests/test_forms_from_non_typing_sequences.py

    from fastapi import FastAPI, Form
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    
    @app.post("/form/python-list")
    def post_form_param_list(items: list = Form()):
        return items
    
    
    @app.post("/form/python-set")
    def post_form_param_set(items: set = Form()):
        return items
    
    
    @app.post("/form/python-tuple")
    def post_form_param_tuple(items: tuple = Form()):
        return items
    
    
    client = TestClient(app)
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri May 13 23:38:22 UTC 2022
    - 1.2K bytes
    - Viewed (0)
  2. docs_src/request_files/tutorial003_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(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"),
    ):
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri May 13 23:38:22 UTC 2022
    - 888 bytes
    - Viewed (0)
  3. tests/test_tutorial/test_body/test_tutorial001.py

    def test_body_float(client: TestClient):
        response = client.post("/items/", json={"name": "Foo", "price": 50.5})
        assert response.status_code == 200
        assert response.json() == {
            "name": "Foo",
            "price": 50.5,
            "description": None,
            "tax": None,
        }
    
    
    def test_post_with_str_float(client: TestClient):
        response = client.post("/items/", json={"name": "Foo", "price": "50.5"})
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 14.7K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_body/test_tutorial001_py310.py

    def test_body_float(client: TestClient):
        response = client.post("/items/", json={"name": "Foo", "price": 50.5})
        assert response.status_code == 200
        assert response.json() == {
            "name": "Foo",
            "price": 50.5,
            "description": None,
            "tax": None,
        }
    
    
    @needs_py310
    def test_post_with_str_float(client: TestClient):
        response = client.post("/items/", json={"name": "Foo", "price": "50.5"})
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 15K bytes
    - Viewed (0)
  5. docs_src/request_files/tutorial002.py

    from typing import List
    
    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("/")
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri May 13 23:38:22 UTC 2022
    - 811 bytes
    - Viewed (0)
  6. docs_src/request_files/tutorial002_an_py39.py

    from typing import Annotated
    
    from fastapi import FastAPI, File, UploadFile
    from fastapi.responses import HTMLResponse
    
    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_files(files: Annotated[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]}
    
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 826 bytes
    - Viewed (0)
  7. tests/test_tutorial/test_request_files/test_tutorial001_02_an_py39.py

        return client
    
    
    @needs_py39
    def test_post_form_no_body(client: TestClient):
        response = client.post("/files/")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "No file sent"}
    
    
    @needs_py39
    def test_post_uploadfile_no_body(client: TestClient):
        response = client.post("/uploadfile/")
        assert response.status_code == 200, response.text
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 8.5K bytes
    - Viewed (0)
  8. src/net/http/requestwrite_test.go

    			"\r\n" +
    			"abcdef",
    	},
    
    	// HTTP/1.1 POST with Content-Length in headers
    	4: {
    		Req: Request{
    			Method: "POST",
    			URL:    mustParseURL("http://example.com/"),
    			Host:   "example.com",
    			Header: Header{
    				"Content-Length": []string{"10"}, // ignored
    			},
    			ContentLength: 6,
    		},
    
    		Body: []byte("abcdef"),
    
    		WantWrite: "POST / HTTP/1.1\r\n" +
    			"Host: example.com\r\n" +
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 07 01:07:32 UTC 2022
    - 23.3K bytes
    - Viewed (0)
  9. tests/test_additional_properties_bool.py

        pass
    
    
    app = FastAPI()
    
    
    @app.post("/")
    async def post(
        foo: Union[Foo, None] = None,
    ):
        return foo
    
    
    client = TestClient(app)
    
    
    def test_call_invalid():
        response = client.post("/", json={"foo": {"bar": "baz"}})
        assert response.status_code == 422
    
    
    def test_call_valid():
        response = client.post("/", json={})
        assert response.status_code == 200
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 4.2K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/test/testdata/zero_test.go

    // Code generated by gen/zeroGen.go. DO NOT EDIT.
    
    package main
    
    import "testing"
    
    type Z1 struct {
    	pre  [8]byte
    	mid  [1]byte
    	post [8]byte
    }
    
    //go:noinline
    func zero1_ssa(x *[1]byte) {
    	*x = [1]byte{}
    }
    func testZero1(t *testing.T) {
    	a := Z1{[8]byte{255, 255, 255, 255, 255, 255, 255, 255}, [1]byte{255}, [8]byte{255, 255, 255, 255, 255, 255, 255, 255}}
    	zero1_ssa(&a.mid)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Dec 23 06:40:04 UTC 2020
    - 49.6K bytes
    - Viewed (0)
Back to top