I am probably mis-reading this tutorial, but I am kinda lost http://www.voidspace.org.uk/python/arti ... ion.shtmlc
Here's the code I am using
- Code: Select all
def login(username, password):
import urllib2
superURL = 'http://localhost:8090/rest/'
username = 'aaa'
password = 'bbb'
passman = urllib2.HTTPPasswordMgrWithDefaultRealm()
passman.add_password(None, superURL, username, password)
authhandler = urllib2.HTTPBasicAuthHandler(passman)
opener = urllib2.build_opener(authhandler)
urllib2.install_opener(opener)
pagehandle = urllib2.urlopen("http://localhost:8090/rest/getIndexes.view?v=1.3.0&c=myapp")
print parse(pagehandle).toxml()