Mechanize and NTLM Authentication

前端 未结 2 1837
梦谈多话
梦谈多话 2021-01-16 11:21

The following code generates a 401 => Net::HTTPUnauthorized error.

From the log:


response-header: x-powered-by => ASP.NET
response-header: content         


        
2条回答
  •  滥情空心
    2021-01-16 12:01

    Mechanize 2 supports NTLM auth:

    m = Mechanize.new
    m.agent.username = 'user'
    m.agent.password = 'password'
    m.agent.domain = 'addomain'
    

提交回复
热议问题