Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

start encouraging people to use HTTPClient and not module-global stuff #244

Open
glyph opened this issue May 23, 2019 · 0 comments
Open

Comments

@glyph
Copy link
Member

glyph commented May 23, 2019

Treq has a global HTTP client, and maybe that's a good thing for quick experiments, but it makes testing difficult and creates type confusion.

Instead:

  1. treq.client.HTTPClient should be promoted somewhere more top-level and central, like perhaps treq.session() or somesuch.
  2. the documentation should universally prefer this.
  3. the global instance of this thing should be an explicit global variable (treq.default ?) and all the aliases (treq.get, treq.post et. al.) should be deprecated.

Previously: #242 #243

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants