Skip to content

Stream tweak#1607

Merged
lovelydinosaur merged 18 commits intomasterfrom
stream-tweak
Apr 28, 2021
Merged

Stream tweak#1607
lovelydinosaur merged 18 commits intomasterfrom
stream-tweak

Conversation

@lovelydinosaur
Copy link
Copy Markdown
Contributor

Minor refactoring around usage of Request(stream=...) and Response(stream=...).

  • Reorder code in __init__ so that the default case comes first, and the raw stream=... case comes second.
  • Creating requests using request = Request(..., stream=...) should create a request without any headers being pre-populated. Eg. creating a request within a transport would use something like request = Request(method=..., url=..., headers=..., stream=...) which should not auto-populate any additional headers.

@lovelydinosaur lovelydinosaur added the refactor Issues and PRs related to code refactoring label Apr 28, 2021
@lovelydinosaur lovelydinosaur merged commit 4fbf275 into master Apr 28, 2021
@lovelydinosaur lovelydinosaur deleted the stream-tweak branch April 28, 2021 19:39
@johtso
Copy link
Copy Markdown
Contributor

johtso commented Apr 28, 2021

Ooo, nice! Will be happy to delete a bit of code in httpx-caching and just use Request objects internally.

@lovelydinosaur lovelydinosaur mentioned this pull request Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Issues and PRs related to code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants