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

Add support for auth parameter #12

Open
dlopes7 opened this issue Feb 28, 2022 · 2 comments
Open

Add support for auth parameter #12

dlopes7 opened this issue Feb 28, 2022 · 2 comments

Comments

@dlopes7
Copy link

dlopes7 commented Feb 28, 2022

python-requests supports passing an auth object, example:

r = request(method, url, auth=("user", "password"))

It detects basic authentication and builds the Basic {b64encoded} Authentication header for you
It would be nice if mureq also supported this, to more easily replace requests in scripts that make use of auth

@slingamn
Copy link
Owner

Thanks for the suggestion. I'll consider it, but I'm thinking I probably won't do this:

  1. It's fairly easy for clients to build the Authorization header themselves in this case.
  2. mureq cannot support the fully general use case of the auth parameter (an arbitrarily callable that mutates the requests.Request object), since it has no analogue of the requests.Requests class.

@dlopes7
Copy link
Author

dlopes7 commented Feb 28, 2022

Understandable, thanks

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

No branches or pull requests

2 participants