How do I log in automatically through a get, with the Request library in python?

Asked

Viewed 208 times

-2

Code:

import requests

username = 'admin'
password = 'admin'


headers = {'login': username,
           'password': password
          }

url = 'http://192.162.1.122/ISAPI/Event/notification/httpServers/ID'

r = requests.put(url, headers=headers)


print(r.status_code)
print(r.text)

Upshot:

Relate the item

Document Error: Unauthorized

Access Error: 401 -- Unauthorized

Authentication Error

Process finished with Exit code 0

Documentation:

inserir a descrição da imagem aqui

  • By the documentation print that is Soap my dear.

  • I believe that yes, the documentation lacks data, this complicated

1 answer

0

Good afternoon I managed to connect, now to the problem is to get was in XML, now the problem and other, to get the data

connected as follows http://usuario:[email protected]........./ / / and sent the correct xml

Browser other questions tagged

You are not signed in. Login or sign up in order to post.