- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 1,214 for posAt (0.04 sec)
-
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) -
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) -
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) -
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) -
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) -
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) -
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) -
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) -
pkg/config/analysis/analyzers/testdata/authorizationpolicies.yaml
- source: namespaces: ["httpbin"] # Namespace exists to: - operation: methods: ["GET"] paths: ["/info*"] - operation: methods: ["POST"] paths: ["/data"] when: - key: request.auth.claims[iss] values: ["https://accounts.google.com"] --- apiVersion: security.istio.io/v1beta1 kind: AuthorizationPolicy metadata:
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Wed Mar 08 14:14:46 UTC 2023 - 7.8K bytes - Viewed (0) -
tests/test_union_body.py
class Item(BaseModel): name: Optional[str] = None class OtherItem(BaseModel): price: int @app.post("/items/") def save_union_body(item: Union[OtherItem, Item]): return {"item": item} client = TestClient(app) def test_post_other_item(): response = client.post("/items/", json={"price": 100}) 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 - 4.6K bytes - Viewed (0)