12345678910111213141516171819202122232425262728293031323334 |
- import 'dart:convert';
- import 'dart:core';
- import 'package:http/http.dart' as http;
- import 'package:employee_selfservice_mobile/constants.dart';
- import 'dart:developer' as developer;
-
- import 'package:shared_preferences/shared_preferences.dart';
-
- class HistorySlipGaji_Post {
- late String session;
-
- HistorySlipGaji_Post({required this.session});
-
- static Future<String> connectToAPI() async {
- String URL = baseURL + "/api/v1/history_slip_gaji";
-
- final SharedPreferences prefs = await SharedPreferences.getInstance();
- final session = prefs.getString('session');
-
- var sendData = await http.post(Uri.parse(URL), body: jsonEncode({
- "data": [
- {
- "session": session
- }
- ]
- }), headers: {
- "Content-Type": "application/json",
- "Api-key": apiKey
- });
-
- developer.log(sendData.body, name: "History Slip Gaji Result");
- return sendData.body;
- }
- }
|