No Description
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.

historyReimburse_post.dart 919B

12345678910111213141516171819202122232425262728293031323334
  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 HistoryReimburse_Post {
  8. late String session;
  9. HistoryReimburse_Post({required this.session});
  10. static Future<String> connectToAPI() async {
  11. String URL = baseURL + "/api/v1/history_reimburse";
  12. final SharedPreferences prefs = await SharedPreferences.getInstance();
  13. final session = prefs.getString('session');
  14. var sendData = await http.post(Uri.parse(URL), body: jsonEncode({
  15. "data": [
  16. {
  17. "session": session
  18. }
  19. ]
  20. }), headers: {
  21. "Content-Type": "application/json",
  22. "Api-key": apiKey
  23. });
  24. developer.log(sendData.body, name: "Get History Reimburse Result");
  25. return sendData.body;
  26. }
  27. }