views:

51

answers:

1

I want to use python's urllib2 with authentication and I need the realm and uri of a url. How do I get it?

thanks

A: 

When you make a request for a resource that requires authentication, the server will respond with a 401 status code, and a header that contains the realm:

WWW-Authenticate: Basic realm="the realm"

The URI is the URL you're trying to access.

Jonathan Feinberg
just figured it out myself. Use Live-Http headers for this purpose
Guy