ags_authrest2 0.0.3 copy "ags_authrest2: ^0.0.3" to clipboard
ags_authrest2: ^0.0.3 copied to clipboard

unlistedoutdated

ags_authrest project.

TODO: Put a short description of the package here that helps potential users

know whether this package might be useful for them.

Features #

TODO: List what your package can do. Maybe include images, gifs, or videos.

Getting started #

TODO: List prerequisites and provide or point to information on how to

start using the package.

Usage #

TODO: Include short and useful examples for package users. Add longer examples

to /example folder.

import 'package:ags_authrest2/ags_authrest.dart';
import 'package:http/http.dart' as http;

  Exlample() async {
    var auth = Ags_restauth();

    auth.SECERT_JWT = 'ihavealongpassword';

    auth.R_USER = 'karantest';

// body + headers

    var headers = {
      'path': 'test',

      'port': '5016',

      'Authorization': auth.genTokenEncryp(), // gentoken and encryp

      'Content-Type': 'application/json'
    };

    var bodyData = {
      "phone": "+66885257777",
      "otpCode": "778747",
      "refCode": "orxh4f",
      "fromBU": "Qsms"
    };

//

    var body = json.encode(bodyData);

    var request = http.Request('POST', Uri.parse('http://localhost:3999/'));

    request.body = json.encode(auth.encrypbody(body)); //encrypbody

    request.headers.addAll(headers);

    print(request.body);

    http.StreamedResponse response = await request.send();

    if (response.statusCode == 200) {
      print(await response.stream.bytesToString());
    } else {
      print(response.reasonPhrase);
    }
  }

Additional information #

TODO: Tell users more about the package: where to find more information, how to

contribute to the package, how to file issues, what response they can expect

from the package authors, and more.

1
likes
0
points
124
downloads

Publisher

unverified uploader

Weekly Downloads

ags_authrest project.

Homepage

License

unknown (license)

Dependencies

crypto, dart_jsonwebtoken, encrypt, flutter, http, intl

More

Packages that depend on ags_authrest2