emptygif
ભાષા: ગુજરાતી

બધી ભાષાઓ અને ફ્રેમવર્ક

Laravel PHP

Laravel માટે PHP સ્નિપેટ, જે /pixel.gif પરની રિક્વેસ્ટનો જવાબ empty GIF થી આપે છે. GIF સ્ટાર્ટઅપ વખતે એક જ વાર ડિકોડ થાય છે.

Laravel PHP

ઇન્સ્ટૉલ
composer create-project laravel/laravel app
ફાઇલ
web.php
ચલાવો
php artisan serve --port=8080
<?php

// routes/web.php
use Illuminate\Support\Facades\Route;

Route::get('/pixel.gif', function () {
    $gif = base64_decode('R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==');

    return response($gif, 200, [
        'Content-Type' => 'image/gif',
        'Content-Length' => strlen($gif),
        'Cache-Control' => 'no-store',
    ]);
});

અમે આ સ્નિપેટ ચલાવ્યો અને તેણે પરત કરેલા બાઇટની સરખામણી કરી.

ચકાસો

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

સત્તાવાર સાઇટ: Laravel

PHP માં વધુ