通过在Android上运行的restApi(在iOS中不起作用)以抖动的方式上传图像

您好,所有人都无法在服务器上上传图片,但在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!");
    });
  }
luojuncai 回答:通过在Android上运行的restApi(在iOS中不起作用)以抖动的方式上传图像

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3103826.html

大家都在问