- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 135 for httpie (0.41 sec)
-
tests/test_security_http_digest.py
client = TestClient(app) def test_security_http_digest(): response = client.get("/users/me", headers={"Authorization": "Digest foobar"}) assert response.status_code == 200, response.text assert response.json() == {"scheme": "Digest", "credentials": "foobar"} def test_security_http_digest_no_credentials(): response = client.get("/users/me")
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 2K bytes - Viewed (0) -
tests/test_security_http_bearer_optional.py
client = TestClient(app) def test_security_http_bearer(): response = client.get("/users/me", headers={"Authorization": "Bearer foobar"}) assert response.status_code == 200, response.text assert response.json() == {"scheme": "Bearer", "credentials": "foobar"} def test_security_http_bearer_no_credentials(): response = client.get("/users/me")
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 2.1K bytes - Viewed (0) -
fastapi/security/http.py
from starlette.status import HTTP_401_UNAUTHORIZED, HTTP_403_FORBIDDEN from typing_extensions import Annotated, Doc class HTTPBasicCredentials(BaseModel): """ The HTTP Basic credentials given as the result of using `HTTPBasic` in a dependency. Read more about it in the [FastAPI docs for HTTP Basic Auth](https://fastapi.tiangolo.com/advanced/security/http-basic-auth/). """
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Fri Apr 19 15:29:38 GMT 2024 - 13.2K bytes - Viewed (0) -
docs_src/metadata/tutorial001.py
summary="Deadpool's favorite app. Nuff said.", version="0.0.1", terms_of_service="http://example.com/terms/", contact={ "name": "Deadpoolio the Amazing", "url": "http://x-force.example.com/contact/", "email": "******@****.***", }, license_info={ "name": "Apache 2.0", "url": "https://www.apache.org/licenses/LICENSE-2.0.html", }, ) @app.get("/items/")
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 805 bytes - Viewed (0) -
tests/test_tutorial/test_custom_docs_ui/test_tutorial001.py
def test_swagger_ui_html(client: TestClient): response = client.get("/docs") assert response.status_code == 200, response.text assert ( "https://unpkg.com/swagger-ui-dist@5.9.0/swagger-ui-bundle.js" in response.text ) assert "https://unpkg.com/swagger-ui-dist@5.9.0/swagger-ui.css" in response.text def test_swagger_ui_oauth2_redirect_html(client: TestClient):
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Mon Oct 30 09:58:58 GMT 2023 - 1.3K bytes - Viewed (0) -
tests/test_exception_handlers.py
app = FastAPI( exception_handlers={ HTTPException: http_exception_handler, RequestValidationError: request_validation_exception_handler, Exception: server_error_exception_handler, } ) client = TestClient(app) @app.get("/http-exception") def route_with_http_exception(): raise HTTPException(status_code=400) @app.get("/request-validation/{param}/")
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Thu Feb 17 12:40:12 GMT 2022 - 1.9K bytes - Viewed (0) -
docs_src/custom_response/tutorial006.py
from fastapi import FastAPI from fastapi.responses import RedirectResponse app = FastAPI() @app.get("/typer") async def redirect_typer():
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Sat Jul 03 19:51:28 GMT 2021 - 199 bytes - Viewed (0) -
docs_src/response_model/tutorial003_03.py
from fastapi import FastAPI from fastapi.responses import RedirectResponse app = FastAPI() @app.get("/teleport") async def get_teleport() -> RedirectResponse:
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Tue Jan 10 16:22:47 GMT 2023 - 241 bytes - Viewed (0) -
docs_src/response_model/tutorial003_02.py
from fastapi.responses import JSONResponse, RedirectResponse app = FastAPI() @app.get("/portal") async def get_portal(teleport: bool = False) -> Response: if teleport: return RedirectResponse(url="https://www.youtube.com/watch?v=dQw4w9WgXcQ")
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Tue Jan 10 16:22:47 GMT 2023 - 381 bytes - Viewed (0) -
docs_src/response_model/tutorial003_04_py310.py
from fastapi.responses import RedirectResponse app = FastAPI() @app.get("/portal") async def get_portal(teleport: bool = False) -> Response | dict: if teleport: return RedirectResponse(url="https://www.youtube.com/watch?v=dQw4w9WgXcQ")
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Tue Jan 10 16:22:47 GMT 2023 - 352 bytes - Viewed (0)