0

I was using httpi-ntlm ruby gem to get the RSS feeds from the given url, username and password.

I want to know if there is a way I can use all three auth types in my method so that the server picks the setting it prefers???

def get_data url,user,password
    request = HTTPI::Request.new(url)
    request.auth.ntlm(user,password)
    response = HTTPI.get request
    return  response.raw_body 
end
user703099
  • 15
  • 4

1 Answers1

0

You would need to try with one request, if that fails, or you get a header back with the information on what type of authorisation to use, then you can use that auth instead.

Several different auth types use the same Authorization header, hence why you can't send different types of auth at the same time.

Shaun McDonald
  • 6,436
  • 2
  • 25
  • 23
  • Yes that what I did, sent out a plain request and checked the auth_type and sent a second request with the right auth_type – user703099 Oct 15 '12 at 22:30