DigestAuth doesn't re-auth with provided WWW-Authenticate

I am trying to use DigestAuth but it seems that requests doesn't try to complete the negotiation:

```
In [19]: url = 'http://crawdad.org//download/cambridge/haggle/imote-trace1.tar.gz'

*In [20]: r = requests.get(url, auth=requests.auth.HTTPDigestAuth(user, passw))
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): crawdad.org
send: 'GET //download/cambridge/haggle/imote-trace1.tar.gz HTTP/1.1\r\nHost: crawdad.org\r\nConnection: keep-alive\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nUser-Agent: python-requests/2.8.1\r\n\r\n'
reply: 'HTTP/1.1 401 Unauthorized\r\n'
header: Date: Thu, 17 Dec 2015 14:20:14 GMT
header: Server: Apache/2.4.10 (Fedora)
header: WWW-Authenticate: Basic realm="Dartmouth wireless-network traces"
header: Content-Length: 88
header: Connection: close
header: Content-Type: text/html; charset=iso-8859-1
DEBUG:requests.packages.urllib3.connectionpool:"GET //download/cambridge/haggle/imote-trace1.tar.gz HTTP/1.1" 401 88

In [21]: r.status_code
Out[21]: 401

In [22]: requests.__version__
Out[22]: '2.8.1'
```

note how it goes with wget (credentials are within ~/.netrc, I have masked out ETag and Authorization fields in the trace below):

```
$> wget -S --debug http://crawdad.org//download/cambridge/haggle/imote-trace1.tar.gz        
DEBUG output created by Wget 1.16.3 on linux-gnu.

URI encoding = ‘UTF-8’
--2015-12-17 09:26:07--  http://crawdad.org//download/cambridge/haggle/imote-trace1.tar.gz
Host ‘crawdad.org’ has not issued a general basic challenge.
Resolving crawdad.org (crawdad.org)... 129.170.213.101
Caching crawdad.org => 129.170.213.101
Connecting to crawdad.org (crawdad.org)|129.170.213.101|:80... connected.
Created socket 4.
Releasing 0x00005578fbb08ee0 (new refcount 1).

---request begin---
GET //download/cambridge/haggle/imote-trace1.tar.gz HTTP/1.1
User-Agent: Wget/1.16.3 (linux-gnu)
Accept: */*
Accept-Encoding: identity
Host: crawdad.org
Connection: Keep-Alive

---request end---
HTTP request sent, awaiting response... 
---response begin---
HTTP/1.1 401 Unauthorized
Date: Thu, 17 Dec 2015 14:26:07 GMT
Server: Apache/2.4.10 (Fedora)
WWW-Authenticate: Basic realm="Dartmouth wireless-network traces"
Content-Length: 88
Connection: close
Content-Type: text/html; charset=iso-8859-1

---response end---

  HTTP/1.1 401 Unauthorized
  Date: Thu, 17 Dec 2015 14:26:07 GMT
  Server: Apache/2.4.10 (Fedora)
  WWW-Authenticate: Basic realm="Dartmouth wireless-network traces"
  Content-Length: 88
  Connection: close
  Content-Type: text/html; charset=iso-8859-1
Closed fd 4
Auth scheme found 'Basic'
Auth param list ' realm="Dartmouth wireless-network traces"'
Auth param realm=Dartmouth wireless-network traces
Authentication selected: Basic realm="Dartmouth wireless-network traces"
Inserted ‘crawdad.org’ into basic_authed_hosts
Found crawdad.org in host_name_addresses_map (0x5578fbb08ee0)
Connecting to crawdad.org (crawdad.org)|129.170.213.101|:80... connected.
Created socket 4.
Releasing 0x00005578fbb08ee0 (new refcount 1).

---request begin---
GET //download/cambridge/haggle/imote-trace1.tar.gz HTTP/1.1
User-Agent: Wget/1.16.3 (linux-gnu)
Accept: */*
Accept-Encoding: identity
Host: crawdad.org
Connection: Keep-Alive
Authorization: Basic XXXXXXXXXXXXXXXXXX==

---request end---
HTTP request sent, awaiting response... 
---response begin---
HTTP/1.1 200 OK
Date: Thu, 17 Dec 2015 14:26:08 GMT
Server: Apache/2.4.10 (Fedora)
Last-Modified: Tue, 17 Oct 2006 21:49:43 GMT
ETag: "XXXX-XXXXXXXXXXXXXX"
Accept-Ranges: bytes
Content-Length: 29345
Connection: close
Content-Type: application/x-gzip

---response end---

  HTTP/1.1 200 OK
  Date: Thu, 17 Dec 2015 14:26:08 GMT
  Server: Apache/2.4.10 (Fedora)
  Last-Modified: Tue, 17 Oct 2006 21:49:43 GMT
  ETag: "XXXX-XXXXXXXXXXXXXX"
  Accept-Ranges: bytes
  Content-Length: 29345
  Connection: close
  Content-Type: application/x-gzip
Length: 29345 (29K) [application/x-gzip]
Saving to: ‘imote-trace1.tar.gz.4’

imote-trace1.tar.gz.4            100%[==========================================================>]  28.66K  --.-KB/s   in 0.002s 

Closed fd 4
2015-12-17 09:26:08 (13.3 MB/s) - ‘imote-trace1.tar.gz.4’ saved [29345/29345]
```

P.S. if you are to decide to access that file, http://crawdad.org/joinup.html is the registration page


The reason you're not authenticating is because the remote service isn't doing Digest auth, it's doing basic. Try `r = requests.get(url, auth=(user, passw))`.


Thank you @Lukasa .  I guess something else went wrong for me originally (when I thought I did use basic auth), and I did misread wget output (which first "senses" which authentication mechanism to use).  Sorry about the noise