aiohttp
aiohttp copied to clipboard
Support chunked=False
What do these changes do?
Are there changes in behavior for the user?
Related issue number
Checklist
- [x] I think the code is well written
- [ ] Unit tests for the changes exist
- [ ] Documentation reflects the changes
- [ ] If you provide code modification, please add yourself to
CONTRIBUTORS.txt- The format is <Name> <Surname>.
- Please keep alphabetical order, the file is sorted by names.
- [ ] Add a new news fragment into the
CHANGESfolder- name it
<issue_id>.<type>for example (588.bugfix) - if you don't have an
issue_idchange it to the pr id after creating the pr - ensure type is one of the following:
.feature: Signifying a new feature..bugfix: Signifying a bug fix..doc: Signifying a documentation improvement..removal: Signifying a deprecation or removal of public API..misc: A ticket has been closed, but it is not of interest to users.
- Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."
- name it
As far as I can tell the None usage dates back to the start of the git history, 9 years ago. So, I'm inclined to say that it was probably a mistake.
If so, we should also change the type of the parameters to bool. It doesn't look like there's any reason for the argument to be None (though maybe we should leave it in the 3.x branch to keep backwards compatibility).
Maybe None should mean that aiohttp shall set it to True / False based on other request parameters, but if given as True / False to get() / post() / ... by the user aiohttp should do as told. Just an idea...
My use case is to start POST request and leave the connection open. Data is written to this requests body many times during the programs execution. Tunneling data over HTTP in other words. My initial testing showed that chunking is not supported by the server. You can see this document for more info: https://opensource.apple.com/source/QuickTimeStreamingServer/QuickTimeStreamingServer-412.42/Documentation/RTSP_Over_HTTP.pdf
I just found out that if Content-Length is part of headers it will not be chunked in my use case. So this PR is not needed for me personally anymore, but could possibly be useful to others? If not, feel free to close it.