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

multipart http requests support (file uploads) #15

Open
DonsWayo opened this issue Jan 1, 2020 · 4 comments
Open

multipart http requests support (file uploads) #15

DonsWayo opened this issue Jan 1, 2020 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed urgent 🚨 This issue or feature needs to be worked on urgently

Comments

@DonsWayo
Copy link

DonsWayo commented Jan 1, 2020

Is posible to create a multipart request with this library?

Thanks!

@jossef
Copy link
Owner

jossef commented Jan 9, 2020

it's a good feature. not yet implemented.
would you like to fork this repo, add multipart support and submit a PR?

@jossef jossef added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Jan 9, 2020
@mingsai
Copy link

mingsai commented May 21, 2020

Seems like this might be a good place to start (source):

var uri = Uri.parse('https://example.com/create');
var request = http.MultipartRequest('POST', uri)
  ..fields['user'] = '[email protected]'
  ..files.add(await http.MultipartFile.fromPath(
      'package', 'build/package.tar.gz',
      contentType: MediaType('application', 'x-tar')));
var response = await request.send();
if (response.statusCode == 200) print('Uploaded!');

@jossef jossef changed the title How to make multipart request? multipart http requests support (file uploads) May 23, 2020
@jossef
Copy link
Owner

jossef commented May 23, 2020

📣 Need help on this one. Please submit a PR 🙏

@mark8044
Copy link

+1 on this.

Requests has been a game changer. However I recently came across the need to upload images and find myself having to unwind this package from my app completely. This type of package is all-or-none so this is a must-need addition.

Holding out hope for this!

@sehnryr sehnryr added the urgent 🚨 This issue or feature needs to be worked on urgently label Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed urgent 🚨 This issue or feature needs to be worked on urgently
Projects
None yet
Development

No branches or pull requests

5 participants