我只想問如何使一個連接[用戶+傳遞]與一個頁面,給你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