emptygif
زبان: اردو

تمام زبانیں اور فریم ورکس

Hunchentoot Common Lisp

Hunchentoot کے لیے Common Lisp کا اسنیپٹ جو /pixel.gif کی درخواستوں کا جواب خالی GIF سے دیتا ہے، جسے اسٹارٹ اپ پر ایک بار ڈیکوڈ کیا جاتا ہے۔

Hunchentoot Common Lisp

انسٹال
(ql:quickload '(:hunchentoot :cl-base64))
فائل
server.lisp
چلائیں
sbcl --load server.lisp
(ql:quickload '(:hunchentoot :cl-base64))

(defparameter *gif*
  (cl-base64:base64-string-to-usb8-array "R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="))

(hunchentoot:define-easy-handler (pixel :uri "/pixel.gif") ()
  (setf (hunchentoot:content-type*) "image/gif"
        (hunchentoot:header-out :cache-control) "no-store")
  *gif*)

(hunchentoot:start (make-instance 'hunchentoot:easy-acceptor :port 8080))

ہم نے یہ اسنیپٹ چلایا اور اس کی لوٹائی ہوئی بائٹس کا موازنہ کیا۔

جانچیں

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

آفیشل سائٹ: Hunchentoot