emptygif
Dil: Türkçe

Tüm diller ve framework'ler

Quart Python

Quart için, /pixel.gif isteklerine başlangıçta bir kez çözülen boş GIF ile yanıt veren bir Python örneği.

Quart Python

Kurulum
pip install quart
Dosya
app.py
Çalıştır
quart --app app run --port 8080
import base64

from quart import Quart, Response

GIF = base64.b64decode("R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==")

app = Quart(__name__)


@app.get("/pixel.gif")
async def pixel():
    return Response(GIF, mimetype="image/gif", headers={"Cache-Control": "no-store"})

Bu örneği çalıştırıp döndürdüğü baytları karşılaştırdık.

Kontrol et

curl -sI http://localhost:8080/pixel.gif

Resmî site: Quart

Python için daha fazlası