Closed twm closed 6 months ago
For cgi.parse_multipart
, treq is likely to be better off using the multipart
module from PyPI. email.message
is often not quite right for HTTP form data, despite the similar encoding.
Does multipart
support non-blocking API?
I took a very quick look at the code and I don't see any callback/non-blocking support. Maybe I need to dig deeper.
I have this code that I am using in prod for my app https://gist.github.com/adiroiban/7f593d6d18113aae797ad081e07f4745 ... but this uses a fork of twisted web with support for replacing the custom content handler
If anyone is interested, I am happy to get something based on this code into twisted ... I also have tests for it.. but have not added them in the gist.
There are two uses of the
cgi
module in treq:cgi.parse_header()
intreq.content
— suggested replacement isemail.message.Message
cgi.parse_multipart()
intreq.test.test_multipart
— same suggested replacement