Gary's Blog
  • Home
  • Github
  • English
    English中文 (中国)

Tag: cURL

Simulate streaming API with FastAPI

2024-02-20 226 Technical, 记录 cURL, FastAPi, Python Leave a Comment
The server code import asyncio import uvicorn from fastapi import FastAPI from fastapi.responses import StreamingResponse app = FastAPI() async def fake_text_streaming(): for i in range(1000): yield b"Fake text #" + str(i).encode() + b"\n" await asyncio.sleep(1) @app.post("/") @app…

Tag Cloud

American Companies ASR Authentication Azure Careers Cloudflare cURL Debian Email ESXi ESXi 8 FastAPi ffmpeg Fortune 500 Jobs Jupyter Kafka Keycloak LinkedIn MacOS MySQL OpenAI pip Plugin Python RDP Remote Connect Reverse Proxy RSS rustdesk Samba Screen Sharing sleep mode SMTP spring boot ssh Thymeleaf tunnel Ubuntu uv VNC Windo Windows WordPress ZeroTrust
Theme: Maizi. Powered by WordPress.