Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put request with multipartform/data content type sends an empty request #1081

Closed
Khader-1 opened this issue Mar 15, 2021 · 9 comments
Closed

Comments

@Khader-1
Copy link

New Issue Checklist

  • I have searched for a similar issue in the project and found none

Issue Info

Info Value
Platform Name flutter / web / android
Dio Version 3.0.0
Repro rate all the time (100%)

Issue Description and Steps

when sending a put/patch request with data being a FormData object it just sends empty body, I have tried to set the "Content-Type" to "multipart/form-data" but nothing changed.

@fuadarradhi
Copy link

same here

@BigBrosh
Copy link

I've seen similar issue on 2018
#88

Suggestion in this issue was to send map instead of form data
But I'd like my library to be able to send form data and attach multipart files as part of request
It's crucial
Please take a look

I can also see that there's actually logic both for form data and multipart files
image

@Khader-1
Copy link
Author

I've seen similar issue on 2018
#88

Suggestion in this issue was to send map instead of form data
But I'd like my library to be able to send form data and attach multipart files as part of request
It's crucial
Please take a look

I can also see that there's actually logic both for form data and multipart files
image

I've seen that one..
As you said I'd like to send multipart files, BTW I ended up switching all the PUT mapping endpoints in my server to POST mapping😞

@stale
Copy link

stale bot commented Jun 4, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, please make sure it is up to date and if so, add a comment that this is still an issue to keep it open. Thank you for your contributions.

@stale stale bot added the stale label Jun 4, 2021
@stale stale bot removed the stale label Jun 15, 2021
@stale
Copy link

stale bot commented Jul 20, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, please make sure it is up to date and if so, add a comment that this is still an issue to keep it open. Thank you for your contributions.

@stale stale bot added the stale label Jul 20, 2021
@stale stale bot closed this as completed Jul 30, 2021
@naaando
Copy link

naaando commented Jun 29, 2023

Seems to happen to me, unfortunally it is very hard to understand at first

@MostafaSolimanMO
Copy link

I am having this issue with dio ^5.3.2
Why is this closed?

@augustineonu
Copy link

I am having this issue with dio ^5.3.2 Why is this closed?

im having this issue too

Future update1() async {
try {
var formData = dio.FormData.fromMap({
'fullName': fullNameController.text,
'file': await dio.MultipartFile.fromFile(pickedImagePath.value,
filename: pickedImagePath.value)
});

  final response = await userService.updateProfile(payload: formData);
  if (response.status == 'success') {
    logger.log("Success:: ${response.message!}");
  } else {
    logger.log("Success:: ${response.message!}");
  }
} catch (exception) {
  logger.log("failed:: ${exception.toString()}");
}

}

this is a PUT reuqest. but now it send the finstance of the file and not the file path as supposed string.

@AlexV525
Copy link
Member

AlexV525 commented Jan 4, 2024

Please submit new issues with minimal reproducible examples and updated info. We're generally not handling issues before Feb 13, 2023.

@AlexV525 AlexV525 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 4, 2024
@cfug cfug locked and limited conversation to collaborators Jan 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants