在Android上通过restApi(不适用于iOS)上传Flitter中的图像

在Android上通过restApi(不适用于iOS)上传Flitter中的图像,rest,http,flutter,multipart,flutter-dependencies,Rest,Http,Flutter,Multipart,Flutter Dependencies,Hi-All无法在服务器上上传图像在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.getToke

Hi-All无法在服务器上上传图像在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!");
    });
  }
静态上载(文件映像)异步{
字符串apirl=host+'/api/v1/profile/mobile/picture/new';
var storage=SecureStorage();
var authToken=await storage.getToken();
映射头={“授权”:authToken};
var postori=Uri.parse(apirl);
http.MultipartRequest-request=新的http.MultipartRequest(“POST”,postari);
request.headers.addAll(headers);
request.files.add(
等待http.MultipartFile.fromPath('image',image.path),
);
request.send().then((响应){
如果(response.statusCode==200)打印(“已上载”);
});
}

请修改问题,什么在工作,什么不清楚。完成修改的问题显示您的后端代码,您如何使用apigateway处理数据包,然后发送到s3图像块。您是否使用Android和iOS的真实设备或虚拟设备?请修改问题,什么在工作,什么不清楚。完成修改的问题显示您的后端代码,您如何使用apigateway处理数据包,然后发送到s3图像块您是否为Android和iOS使用真实设备还是虚拟设备?