mureq icon indicating copy to clipboard operation
mureq copied to clipboard

Add support for auth parameter

Open dlopes7 opened this issue 3 years ago • 2 comments

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

dlopes7 avatar Feb 28 '22 00:02 dlopes7

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.

slingamn avatar Feb 28 '22 02:02 slingamn

Understandable, thanks

dlopes7 avatar Feb 28 '22 13:02 dlopes7