jaguar_client 0.2.0

jaguar_client

Concise JSON client library for Dart and Jaguar based on package:http

  • Built-in PODO serialization using jaguar_serializer
  • Simple and intuitive API
  • Various authentication support
    • JSON authentication
    • url-encoded-form authentication
    • Basic authentication
    • Planned
      • Facebook oauth
      • Google oauth
      • Google 2FA
  • Session management
    • Browser: LocalStorage
    • Flutter: SharedPreferences
    • IO: DB, File
  • JWT authentication support
  • ResourceClient to access DataStore or a resource
  • SerializedJsonClient enables writing concise REST calls
  • Persistent Cookies on Flutter and IO

Usage

Basic requests

Get request

final JsonResponse resp =
    await client.get('http://localhost:8080/api/list');
print(resp.body);

Post request

final JsonResponse resp = await client
    .post('http://localhost:8080/api/map', body: {'posting': 'hello'});
print(resp.body);

Put request

final JsonResponse resp = await client
    .put('http://localhost:8080/api/map', body: {'putting': 'hello'});
print(resp.body);

Delete request

final JsonResponse resp =
    await client.delete('http://localhost:8080/api/map/123?query=why');
print(resp.body);

Automatic serialization

TODO

Authentication

TODO

Session management

TODO

TODO

-[ ] Persist cookie
-[ ] Persist auth header?

Changelog

0.1.5

  • Moved to jaguar_serializer 0.4.x

0.1.4

  • Matchers for testing

0.1.2

  • Fix in bug capturing Bearer auth header

0.1.1

  • Bearer auth header
  • Logout

1. Depend on it

Add this to your package's pubspec.yaml file:

dependencies:
  jaguar_client: "^0.2.0"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:jaguar_client/jaguar_client.dart';

Platforms

About

Write concise JSON API clients

Author

Ravi Teja Gudapati

Homepage

github.com/Jaguar-dart/jaguar_client

Documentation

www.dartdocs.org/documentation/jaguar_client/0.2.0/

Uploader

tejainece@gmail.com

License

BSD (LICENSE)

Published

Nov 3, 2017