Skip to content

A requests library for the Quid json web tokens server

License

Notifications You must be signed in to change notification settings

teal-finance/quidart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quidart

A requests library for the Quid json web tokens server

Usage

Initialize:

import 'package:quidart/quidart.dart';

const quidUri = "http://localhost:8082";
const serverUri = "http://127.0.0.1:5000";
final requests = QuidRequests(
    baseUri: serverUri,
    quidUri: quidUri,
    namespace: "demo",
  );

Login and get a refresh and access token:

import 'package:quidart/src/exceptions.dart';

try {
    await requests.login(
        username: "demouser",
        password: "demouser",
    );
} on QuidException catch (e) {
    if (e.unauthorized) {
        // the login has failed
    }
} catch (e) {
    rethrow;
}

Make a get request:

final uri = "https://myserver.org/path";
final data = await requests.get<Map<String, dynamic>>(uri);

Make a post request:

final data = await requests.post<Map<String, dynamic>>(uri, <Map<String,dynamic>{"foo": "bar"}>);

About

A requests library for the Quid json web tokens server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages