Forum: Ruby on Rails IIS, Net::HTTP::Get, and Basic Authentication

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B0f6756b62559d43213636dde11bb785?d=identicon&s=25 BenH (Guest)
on 2009-05-27 01:32
(Received via mailing list)
I'm getting a 401.2 from IIS
You do not have permission to view this directory or page using the
credentials that you supplied because your Web browser is sending a
WWW-Authenticate header field that the Web server is not configured to
accept.
 The sysadmin says that basic auth is enabled. Is there something
special about how rails handles basic auth? Is there a way for me to
see what the server actually gets and what the headers say is
acceptable?



My Code:
  def get_wsdl(url=nil)
    return false if url.nil?
    url = URI.parse(url) unless url.is_a?(URI)

    connection = Net::HTTP.new(url.host, url.port)
    connection.use_ssl = true
    connection.verify_mode = OpenSSL::SSL::VERIFY_NONE

    connection.start do |http|
      req = Net::HTTP::Get.new("#{url.path}?#{url.query}")
      req.basic_auth 'username','password'
      puts http.request(req).body
    end
  end
This topic is locked and can not be replied to.