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.
 
 
 
 
 

41 lines
1.1 KiB

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 ChangeProfileImage_Post {
late String session;
late String imageBase64;
ChangeProfileImage_Post({required this.session,
required this.imageBase64});
static Future<String> connectToAPI(String imageBase64) async {
String URL = baseURL + "/api/v1/change_profile";
final SharedPreferences prefs = await SharedPreferences.getInstance();
final session = prefs.getString('session');
var sendData = await http.post(Uri.parse(URL), body: jsonEncode({
"data": [
{
"session": session,
"image": imageBase64,
}
]
}), headers: {
"Content-Type": "application/json",
"Api-key": apiKey
});
return sendData.body;
/*var jsonObject = json.decode(sendData.body);
developer.log(jsonObject.toString(), name: 'Log');*/
// return jsonObject;
// return LoginPostResult.createPostResult(jsonObject);
}
}