gazelle_client 0.4.0+2 copy "gazelle_client: ^0.4.0+2" to clipboard
gazelle_client: ^0.4.0+2 copied to clipboard

An easy to use client to connect to Gazelle.

example/gazelle_client_example.dart

import 'package:gazelle_client/gazelle_client.dart';

void main() async {
  final client = GazelleClient.init(
    baseUrl: 'https://api.example.com',
    modelProvider: YourModelProvider(),
  );

  // GET request
  final user = await client.api('users').get<User>(queryParams: {'id': 1});

  // POST request
  final newUser = User(name: 'John Doe', email: 'john@example.com');
  final createdUser = await client.api('users').post<User>(body: newUser);

  // Don't forget to close the client when you're done
  client.api.close();
}
1
likes
140
points
4
downloads

Publisher

verified publisherintales.it

Weekly Downloads

An easy to use client to connect to Gazelle.

Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

gazelle_serialization, http

More

Packages that depend on gazelle_client