コンテンツにスキップ
per page, with , order by , clip by
Results of 1 - 6 of about 6 for httpx (0.004 sec.)
Async Tests 12960
Async Tests Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You have already seen how to test your FastAPI applications using the provided TestClient . Up to now, ... AnyIO provides a neat plugin for this, that allows us to specify that some test functions are to be called asynchronously. HTTPX Even if your FastAPI application uses normal def functions instead of async def , it is still an async application underne ... unning our tests asynchronously, we can no longer use the TestClient inside our test functions. The TestClient is based on HTTPX , and luckily, we can use it directly to test the API. Example For a simple example, let's consider a file structure simil ... to" } The file test_main.py would have the tests for main.py , it could look like this now: Python 3.8+ import pytest from httpx import ASGITransport , AsyncClient from .main import app @pytest . mark . anyio async def test_root (): async with AsyncCl ...
https://man.mtool.work/fastapi/0.115/advanced/async-tests/
テスト 9596
テスト Starlette のおかげで、 FastAPI アプリケーションのテストは簡単で楽しいものになっています。 HTTPX がベースなので、非常に使いやすく直感的です。 これを使用すると、 FastAPI と共に pytest を直接利用できます。 TestClient を使用 TestClient を ... ient を作成し、 FastAPI に渡します。 test_ から始まる名前の関数を作成します (これは pytest の標準的なコンベンションです)。 httpx と同じ様に TestClient オブジェクトを使用します。 チェックしたい Python の標準的な式と共に、シンプルに assert 文を記述します ... == { "detail" : "Item already exists" } リクエストに情報を渡せるクライアントが必要で、その方法がわからない場合はいつでも、 httpx での実現方法を検索 (Google) できます。 テストでも同じことを行います。 例えば: パス または クエリ パラメータを渡すには、それ ... ください。 ヘッダー を渡すには、 headers パラメータに dict を渡します。 cookies の場合、 cookies パラメータに dict です。 ( httpx または TestClient を使用して) バックエンドにデータを渡す方法の詳細は、 HTTPXのドキュメント を確認してください。 情報 TestC ...
https://man.mtool.work/fastapi/0.115/tutorial/testing/
OpenAPI Callbacks 8573
OpenAPI Callbacks Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You could create an API with a path operation that could trigger a request to an external API cre ... to the next. It could be just one or two lines of code, like: callback_url = "https://example.com/api/v1/invoices/events/" httpx . post ( callback_url , json = { "description" : "Invoice paid" , "paid" : True }) But possibly the most important part of ... rt. Tip The actual callback is just an HTTP request. When implementing the callback yourself, you could use something like HTTPX or Requests . Write the callback documentation code This code won't be executed in your app, we only need it to document h ...
https://man.mtool.work/fastapi/0.115/advanced/openapi-callbacks/
FastAPI 8280
FastAPI FastAPI framework, high performance, easy to learn, fast to code, ready for production ドキュメント : https://fastapi.tiangolo.com ソースコード : https://github.com/fastapi/fastapi FastAPI は、Pythonの標準である型ヒントに基づいてPyt ... し同様に簡単な)技術(Pydantic のおかげです)。 以下のようなたくさんのおまけ機能(Starlette のおかげです): WebSockets GraphQL httpx や pytest をもとにした極限に簡単なテスト CORS クッキーセッション ...などなど。 パフォーマンス 独立した TechEmpower のベンチ ... 。 オプションの依存関係 Pydantic によって使用されるもの: email-validator - E メールの検証 Starlette によって使用されるもの: httpx - TestClient を使用するために必要です。 jinja2 - デフォルトのテンプレート設定を使用する場合は必要です。 python-multipart - ...
https://man.mtool.work/fastapi/0.115/
機能 7841
機能 FastAPIの機能 FastAPI は以下の機能をもちます: オープンスタンダード準拠 API作成のための OpenAPI 。これは、 path operations の宣言、パラメータ、ボディリクエスト、セキュリティなどを含んでいます。 JSONスキーマ を使用したデータモデルのドキュ ... ワークの1つです。 WebSocket のサポート GraphQL のサポート プロセス内バックグラウンドタスク 起動およびシャットダウンイベント httpx に基づいて構築されたテストクライアント CORS 、GZip、静的ファイル、ストリーミング応答 セッションとCookie のサポート テストカ ...
https://man.mtool.work/fastapi/0.115/features/
Release Notes 7549
Release Notes Latest Changes 0.115.11 Fixes ? Add docs examples and tests (support) for Annotated custom validations, like AfterValidator , revert #13440 . PR #13442 by @tiangolo . New docs: Query Parameters and String Validations - Custom ... angolo . ? Fix smokeshow, checkout files on CI. PR #12434 by @tiangolo . ? Use uv in CI. PR #12281 by @tiangolo . ⬆ Update httpx requirement from <0.25.0,>=0.23.0 to >=0.23.0,<0.28.0. PR #11509 by @dependabot[bot] . 0.115.2 Upgrades ⬆️ Upgrade Starlet ... linenums in MkDocs Material during local live development to simplify highlighting code. PR #9769 by @tiangolo . ⬆ Update httpx requirement from <0.24.0,>=0.23.0 to >=0.23.0,<0.25.0. PR #9724 by @dependabot[bot] . ⬆ Bump mkdocs-material from 9.1.16 t ...
https://man.mtool.work/fastapi/0.115/release-notes/
PREV 1 NEXT