GSI - Employe Self Service Mobile
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
931 B

2 months ago
  1. import 'dart:convert';
  2. import 'dart:core';
  3. import 'package:http/http.dart' as http;
  4. import 'package:employee_selfservice_mobile/constants.dart';
  5. import 'dart:developer' as developer;
  6. import 'package:shared_preferences/shared_preferences.dart';
  7. class DetailST_Post {
  8. late String id;
  9. late String session;
  10. DetailST_Post({required this.session});
  11. static Future<String> connectToAPI(String id) async {
  12. String URL = baseURL + "/api/v1/detail_st";
  13. final SharedPreferences prefs = await SharedPreferences.getInstance();
  14. final session = prefs.getString('session');
  15. var sendData = await http.post(Uri.parse(URL), body: jsonEncode({
  16. "data": [
  17. {
  18. "id" : id,
  19. "session": session
  20. }
  21. ]
  22. }), headers: {
  23. "Content-Type": "application/json",
  24. "Api-key": apiKey
  25. });
  26. developer.log(sendData.body, name: "Detail ST Result");
  27. return sendData.body;
  28. }
  29. }