psf / requests

A simple, yet elegant, HTTP library.
https://requests.readthedocs.io/en/latest/
Apache License 2.0
52.19k stars 9.33k forks source link

multipart/form-data and a generator... #6826

Closed steve-osfda closed 1 week ago

steve-osfda commented 1 week ago

I used a generator as an argument to data for Content-Type application/json, and that worked fine.

The problem now is that I need to do this for multipart/form-data, and it appears to not support a generator.

Is it possible to furnish a generator for multipart/form-data? If I have to, I will dump the stream into a file and pass a descriptor to the files argument; but seems that you would have furnished a way to use a generator since it is supported for Content-Type application/json

github-actions[bot] commented 1 week ago

As described in the template, we won't be able to answer questions on this issue tracker. Please use Stack Overflow