Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我只想在 Python 中启动一个 CGI HTTP 服务器,它要求用户/密码。我怎样才能做到这一点?
HTTP 基本身份验证(带有询问名称/密码的浏览器弹出框)会很好(并且可能是首选)。
返回状态码 401 和WWW-Authenticate标头将告诉浏览器提示用户输入凭据。有关详细信息,请参阅RFC 2617。
WWW-Authenticate