Net::HTTP::Unauthorized - how do I get at the WWW-Authenticate header?

Posted by Chris McCauley on Stack Overflow See other posts from Stack Overflow or by Chris McCauley
Published on 2010-04-08T10:36:04Z Indexed on 2010/04/08 10:53 UTC
Read the original article Hit count: 396

Filed under:

Given the code below ...

Net::HTTP.start('localhost', 4000) do |http|
    #
    #   usual stuff omitted for clarity
    #
    @response = http.request(req)
end

... if a (well behaved) server returns a 401 (Unauthorized) response, how do I get at the WWW_Authenticate header?

Chris

© Stack Overflow or respective owner

Related posts about ruby