aiohttp icon indicating copy to clipboard operation
aiohttp copied to clipboard

Support chunked=False

Open eerimoq opened this issue 3 years ago • 3 comments

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 CHANGES folder
    • name it <issue_id>.<type> for example (588.bugfix)
    • if you don't have an issue_id change 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."

eerimoq avatar Mar 18 '22 22:03 eerimoq

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).

Dreamsorcerer avatar Mar 18 '22 23:03 Dreamsorcerer

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

eerimoq avatar Mar 19 '22 08:03 eerimoq

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.

eerimoq avatar Mar 19 '22 11:03 eerimoq