我正在尝试使用基本身份验证访问httpbin.org。我必须输入用户名和密码。在命令终端(linux)中使用 telnet 我至少执行:
telnet httpbin.org 80
HEAD /basic-auth/user/passwd HTTP/1.1
Run Code Online (Sandbox Code Playgroud)
它给出了 401 状态代码(未经授权)。
我现在想以某种方式使用用户名和密码访问它(在 Base64 中,输入为用户名:密码)。我以什么方式做到这一点?我试过了(在 401 状态码之后)
HEAD /username:password HTTP/1.1
Run Code Online (Sandbox Code Playgroud)
(但这给出了 404 状态代码)