So I am trying to use the system.net.httpGet function to return the saftware version of my IP camera(s). I keep getting a 401 error response and am uncertain as to why.
url = "http://IPAddressofCamera/cgi-bin/magicBox.cgi?action=getSoftwareVersion" user = 'username' passwd = 'password' vers = system.net.httpGet(url, username=user, password=passwd) print vers
And the response looks like:
Traceback (most recent call last): File "<input>", line 5, in <module> IOError: Server returned HTTP response code: 401 for URL: http://IPAddressofCamera/cgi-bin/magicBox.cgi?action=getSoftwareVersion
When I enter the same address into chrome, it asks for username and password, to which I enter the same user and password as the code. Once this is completed, it displays a webpage with the information I would expect.
Does anyone have any idea as to what could be the problem here?