Google Cloud Run functions (Python) Python
Google Cloud Run functions (Python) साठी Python स्निपेट, जो /pixel.gif वरच्या रिक्वेस्टना empty GIF ने उत्तर देतो. GIF स्टार्टअपला एकदाच डिकोड होतो.
Google Cloud Run functions (Python) Python
import base64
import functions_framework
GIF = base64.b64decode("R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==")
@functions_framework.http
def pixel(request):
if request.path != "/pixel.gif":
return "Not Found", 404
return GIF, 200, {"Content-Type": "image/gif", "Cache-Control": "no-store"}
आम्ही हा स्निपेट चालवला आणि त्याने परत केलेले बाइट्स तुलना करून पाहिले.
तपासा
curl -sI http://localhost:8080/pixel.gif
अधिकृत साइट: Google Cloud Run functions (Python)