您好,所有人都无法在服务器上上传图片,但在Android上工作正常,但在iOS中无法 状态码= android中的200 在iOS中状态代码= 403
static Upload(File image) async {
String apiUrl = host + '/api/v1/profile/mobile/picture/new';
var storage = SecureStorage();
var authToken = await storage.getToken();
Map<String, String> headers = {"Authorization": authToken};
var postUri = Uri.parse(apiUrl);
http.MultipartRequest request = new http.MultipartRequest("POST", postUri);
request.headers.addAll(headers);
request.files.add(
await http.MultipartFile.fromPath('image', image.path),
);
request.send().then((response) {
if (response.statusCode == 200) print("Uploaded!");
});
}