コンテンツにスキップ
per page, with , order by , clip by
Results of 1 - 10 of about 12 for WebSocket (0.003 sec.)
WebSocket 13425
WebSocket FastAPI で WebSocket が使用できます。 WebSockets のインストール まず WebSockets のインストールが必要です。 $ pip install websockets ---> 100% WebSocket クライアント 本番環境 本番環境では、React、Vue.js、Angularなどの最新のフレーム ... ワークで作成されたフロントエンドを使用しているでしょう。 そして、バックエンドとWebSocketを使用して通信するために、おそらくフロントエンドのユーティリティを使用することになるでしょう。 または、ネイティブコードでWeb ... Socketバックエンドと直接通信するネイティブモバイルアプリケーションがあるかもしれません。 他にも、WebSocketのエンドポイントと通信する方法があるかもしれません。 ただし、この例では非常にシンプルなHTML文書といくつかのJavaScriptを、すべ ... 、本番環境で使うことはないでしょう。 本番環境では、上記の方法のいずれかの選択肢を採用することになるでしょう。 しかし、これはWebSocketのサーバーサイドに焦点を当て、実用的な例を示す最も簡単な方法です。 Python 3.8+ from fastapi import FastAPI , WebSocket from ...
https://man.mtool.work/fastapi/0.115/advanced/websockets/
Testing WebSockets 11833
Testing WebSockets Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You can use the same TestClient to test WebSockets. For this, you use the TestClient in a with s ... tatement, connecting to the WebSocket: Python 3.8+ from fastapi import FastAPI from fastapi.testclient import TestClient from fastapi.websockets import WebSocke ... t app = FastAPI () @app . get ( "/" ) async def read_main (): return { "msg" : "Hello World" } @app . websocket ( "/ws" ) async def websocket ( websocket : WebSocket ): await websocket . accept () await websocket . send_json ({ "msg" ... : "Hello WebSocket" }) await websocket . close () def test_read_main (): client = TestClient ( app ) response = client . get ( "/" ) assert r ...
https://man.mtool.work/fastapi/0.115/advanced/testing-websockets/
WebSockets 9144
WebSockets When defining WebSockets, you normally declare a parameter of type WebSocket and with it you can read data from the client and send data to it. It is provided directly by Starlette, but you can import it from fastapi : from fasta ... pi import WebSocket Tip When you want to define dependencies that should be compatible with both HTTP and WebSockets, you can define a paramet ... er that takes an HTTPConnection instead of a Request or a WebSocket . ::: fastapi.WebSocket options: members: - scope - app - url - base_url - headers - query_params - path_params - cookies ... eceive_json - iter_text - iter_bytes - iter_json - send_text - send_bytes - send_json - close When a client disconnects, a WebSocketDisconnect exception is raised, you can catch it. You can import it directly form fastapi : from fastapi import WebSocketDi ...
https://man.mtool.work/fastapi/0.115/reference/websockets/
APIRouter class 8154
APIRouter class Here's the reference information for the APIRouter class, with all its parameters, attributes and methods. You can import the APIRouter class directly from fastapi : from fastapi import APIRouter ::: fastapi.APIRouter option ... s: members: - websocket - include_router - get - put - post - delete - options - head - patch - trace - on_event ...
https://man.mtool.work/fastapi/0.115/reference/apirouter/
HTTPConnection class 8154
HTTPConnection class When you want to define dependencies that should be compatible with both HTTP and WebSockets, you can define a parameter that takes an HTTPConnection instead of a Request or a WebSocket . You can import it from fastapi. ...
https://man.mtool.work/fastapi/0.115/reference/httpconnection/
FastAPI class 8136
FastAPI class Here's the reference information for the FastAPI class, with all its parameters, attributes and methods. You can import the FastAPI class directly from fastapi : from fastapi import FastAPI ::: fastapi.FastAPI options: members ... : - openapi_version - webhooks - state - dependency_overrides - openapi - websocket - include_router - get - put - post - delete - options - head - patch - trace - on_event - middleware - exception_handler ...
https://man.mtool.work/fastapi/0.115/reference/fastapi/
Request class 8136
Request class You can declare a parameter in a path operation function or dependency to be of type Request and then you can access the raw request object directly, without any validation, etc. You can import it directly from fastapi : from ... fastapi import Request Tip When you want to define dependencies that should be compatible with both HTTP and WebSockets, you can define a parameter that takes an HTTPConnection instead of a Request or a WebSocket . ::: fastapi.Request ...
https://man.mtool.work/fastapi/0.115/reference/request/
Status Codes 8047
Status Codes You can import the status module from fastapi : from fastapi import status status is provided directly by Starlette. It contains a group of named constants (variables) with integer status codes. For example: 200: status.HTTP_20 ... 0_OK 403: status.HTTP_403_FORBIDDEN etc. It can be convenient to quickly access HTTP (and WebSocket) status codes in your app, using autocompletion for the name without having to remember the integer status codes by memory ...
https://man.mtool.work/fastapi/0.115/reference/status/
代替ツールから受けたインスピレーションと比較 7871
代替ツールから受けたインスピレーションと比較 何が FastAPI にインスピレーションを与えたのか、他の代替ツールと比較してどうか、そしてそこから何を学んだのかについて。 はじめに FastAPI は、代替ツールのこれまでの働きがなければ存在しなかったでしょ ... フレームワークの基盤として動作します。 Pythonのウェブフレームワーク標準規格 (WSGI) を使用していますが、それは同期的であるためWebSocketなどの利用には対応していません。とはいえ、それでも非常に高い性能を持っています。 これは、「リクエスト」と「レスポンス」の2つ ... CLIを作成できる、面白く珍しい機能を持っています。 以前のPythonの同期型Webフレームワーク標準 (WSGI) をベースにしているため、Websocketなどは扱えませんが、それでも高性能です。 情報 HugはTimothy Crosleyにより作成されました。彼は isort など、Pythonのファイル内の ... きるように設計されており、モジュール化されたコンポーネントを持っています。 以下のような特徴があります。 非常に感動的な性能。 WebSocketのサポート。 GraphQLのサポート。 インプロセスのバックグラウンドタスク。 起動およびシャットダウンイベント。 requestsに基づいて ...
https://man.mtool.work/fastapi/0.115/alternatives/
機能 7747
機能 FastAPIの機能 FastAPI は以下の機能をもちます: オープンスタンダード準拠 API作成のための OpenAPI 。これは、 path operations の宣言、パラメータ、ボディリクエスト、セキュリティなどを含んでいます。 JSONスキーマ を使用したデータモデルのドキュ ... eを強化したものにすぎないため): 見事なパフォーマンス。 NodeJS および Go に匹敵する、最速のPythonフレームワークの1つです。 WebSocket のサポート GraphQL のサポート プロセス内バックグラウンドタスク 起動およびシャットダウンイベント httpx に基づいて構築された ...
https://man.mtool.work/fastapi/0.115/features/
PREV 1 2 NEXT