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

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

Dart Frog Dart

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

Dart Frog Dart

ઇન્સ્ટૉલ
dart pub global activate dart_frog_cli
ફાઇલ
pixel.gif.dart
ચલાવો
dart_frog dev
// routes/pixel.gif.dart: the file name is the route.
import 'dart:convert';

import 'package:dart_frog/dart_frog.dart';

final _gif = base64Decode('R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==');

Response onRequest(RequestContext context) {
  return Response.bytes(
    body: _gif,
    headers: {'content-type': 'image/gif', 'cache-control': 'no-store'},
  );
}

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

ચકાસો

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

સત્તાવાર સાઇટ: Dart Frog

Dart માં વધુ