-
Notifications
You must be signed in to change notification settings - Fork 42
Image Upload Request
Veli Bacik edited this page Nov 26, 2021
·
1 revision
You can make a image upload request like this example:
Future<String?> uploadFile({required File file}) async {
final _formData = FormData.fromMap({
"image": await MultipartFile.fromFile(file.path)
});
return (await _networkManager.uploadFile<String>('http/upload_server.com', _formData,
headers: Map.fromEntries([MapEntry('custom_config', '{"type":"ATTACHMENT"}')])))
.data;
}
My youtube channel: https://www.youtube.com/hardwareandro