Program to do digest authentication using requests module

#!/usr/bin/env python3

import requests
from requests.auth import HTTPDigestAuth

url = ''
response = requests.get(url, auth=HTTPDigestAuth('user', 'pass'))
print('Response.status_code:'+ str(response.status_code))
if response.status_code == 200:
	print('Login successful :'+str(response.json()))
Login successful :{'authenticated': True, 'user': 'user'}

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: