我正在尝试借助 http 请求将用户信息 ( imagePath
, firstName
, ) 上传到服务器。lastName
Future<UserModel> userSignUp({
String firstName,
String lastName,
File imagePath,
}) async {
Map<String, dynamic> data = {
"FNAME": firstName,
"LNAME": lastName,
"image": imagePath
};
var response = await _helper.post(
Services.userSignUp,
isSecure: false,
headers: {
"Content-Type": "application/json",
},
body: json.encode(data),
);
return UserModel.fromJson(response);
}