joinImage static method
Implementation
static Future<String> joinImage(
File file, {
double extendSize = 100.0,
}) async {
//create multipart request for POST or PATCH method
var request = http.MultipartRequest(
'POST', Uri.parse('${Common.url_host}/File/JoinImage'));
//add text fields
request.fields['extendSize'] = extendSize.toString();
request.fields['uid'] = Common.uid.toString();
//create multipart using filepath, string or bytes
var pic = await http.MultipartFile.fromPath('file', file.path);
//add multipart to request
request.files.add(pic);
var response = await request.send();
//Get the response from the server
var responseData = await response.stream.toBytes();
var responseString = String.fromCharCodes(responseData);
return responseString;
}