emptygif
Dil: Türkçe

Tüm diller ve framework'ler

HTTP.jl Julia

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

HTTP.jl Julia

Kurulum
julia -e 'using Pkg; Pkg.add("HTTP")'
Dosya
server.jl
Çalıştır
julia server.jl
using Base64
using HTTP

const GIF = base64decode("R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==")
const HEADERS = ["Content-Type" => "image/gif", "Cache-Control" => "no-store"]

router = HTTP.Router()
HTTP.register!(router, "GET", "/pixel.gif", _ -> HTTP.Response(200, HEADERS, GIF))

HTTP.serve(router, "0.0.0.0", 8080)

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: HTTP.jl

Julia için daha fazlası