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.
如何在 Web 负载性能工具中对请求进行基本身份验证?
您正在做正确的事情,但需要更改顺序 - 将密码和用户名设置移到 wlHttp.Post 命令上方。
在调用 post 命令之前添加
//StartAuthentication wlHttp.OverrideAuthorizationHeader = true; wlHttp.Header["Authorization"] = "Basic XXXXXX"; //EndAuthentication