mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 08:15:16 +00:00
Updated Dio
This commit is contained in:
@ -37,12 +37,17 @@ class APIHelper {
|
||||
else
|
||||
url = Uri.https(config().apiServerName, path);
|
||||
|
||||
final data = FormData.from(request.args);
|
||||
final data = FormData.fromMap(request.args);
|
||||
|
||||
// Process files (if required)
|
||||
if (multipart)
|
||||
request.files.forEach(
|
||||
(k, v) => data.add(k, UploadFileInfo(v, v.path.split("/").last)));
|
||||
for (var key in request.files.keys) {
|
||||
var v = request.files[key];
|
||||
data.files.add(MapEntry(
|
||||
key,
|
||||
await MultipartFile.fromFile(v.path,
|
||||
filename: v.path.split("/").last)));
|
||||
}
|
||||
|
||||
// Execute the request
|
||||
final response = await Dio().post(
|
||||
|
Reference in New Issue
Block a user