我只想问如何使一个连接[用户+传递]与一个页面,给你401响应。Python和401响应
例如PHP中的看起来像
$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);
[?你尝试过什么(http://whathaveyoutried.com) – thegrinner
既然你显然已经知道如何使用PHP的低级别的libcurl包装,你看过Python包装器吗? – abarnert
我尝试搜索但我没有找到我想要的:s – user1801082