I need to take a header like this:
Authorization: Digest qop=\"chap\", realm=\"testrealm@host.com\", username=\"Foobear\", response=\"6629fae
A little regex:
import re reg=re.compile('(\w+)[:=] ?"?(\w+)"?') >>>dict(reg.findall(headers)) {'username': 'Foobear', 'realm': 'testrealm', 'qop': 'chap', 'cnonce': '5ccc069c403ebaf9f0171e9517f40e41', 'response': '6629fae49393a05397450978507c4ef1', 'Authorization': 'Digest'}