I just wanna ask how to make a connection [user+pass] with A page that give you 401 response.
For example in php its seem like that
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://192.168.1.1/');
curl_setopt($ch, CURLOPT_USERPWD, $user.':'.$pass);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 4);
$result = curl_exec($ch);
$returnCode = (int)curl_getinfo($ch, CURLINFO_HTTP_CODE);
You’re looking for the Keyword Basic HTTP Authentication.
I do not recommend using 3rd party modules if you won’t be going further than doing that. If you will, the
requestslibrary already suggested is a great choice.The following example is taken from the urllib2 docs: