Oxygen.jl Julia
Oxygen.jl માટે Julia સ્નિપેટ, જે /pixel.gif પરની રિક્વેસ્ટનો જવાબ empty GIF થી આપે છે. GIF સ્ટાર્ટઅપ વખતે એક જ વાર ડિકોડ થાય છે.
Oxygen.jl Julia
using Base64
using HTTP
using Oxygen
const GIF = base64decode("R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==")
@get "/pixel.gif" function (req::HTTP.Request)
HTTP.Response(200, ["Content-Type" => "image/gif", "Cache-Control" => "no-store"], GIF)
end
serve(host = "0.0.0.0", port = 8080)
અમે આ સ્નિપેટ ચલાવ્યો અને તેણે પરત કરેલા બાઇટની સરખામણી કરી.
ચકાસો
curl -sI http://localhost:8080/pixel.gif