Add support for auth parameter
dlopes7 opened this issue · comments
David Lopes commented
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
Shivaram Lingamneni commented
Thanks for the suggestion. I'll consider it, but I'm thinking I probably won't do this:
- It's fairly easy for clients to build the
Authorization
header themselves in this case. - mureq cannot support the fully general use case of the
auth
parameter (an arbitrarily callable that mutates therequests.Request
object), since it has no analogue of therequests.Requests
class.
David Lopes commented
Understandable, thanks