kuzzleio / sdk-dart

Dart SDK developed for Flutter to interact with Kuzzle API for database storage and search, user authentication and realtime notifications
MIT License
17 stars 4 forks source link

Add HTTP Protocol #62

Closed jenow closed 3 years ago

jenow commented 3 years ago

What does this PR do?

Add HTTP Protocol using https://docs.kuzzle.io/core/2/guides/main-concepts/api/#json-query-endpoint Update flutter sdk.

How to test

import 'package:kuzzle/kuzzle.dart';
import 'package:kuzzle/src/protocols/http.dart';

void main() async {
  final proto = HttpProtocol(
    Uri(
      scheme: 'http',
      host: 'localhost',
      port: 7512
    ),
  );
  final kuzzle = Kuzzle(proto);
  await kuzzle.connect();
  final res = await kuzzle.query(
    KuzzleRequest(
      controller: 'server',
      action: 'now'
    ),
  );
  print(res);
}