So this is my authenticate method,
defcreate_session(self):
self.session = requests.Session()
self.session.headers = {
'Content-Type' : 'application/json-rpc'
}
defauthenticate (self):
data = {
"jsonrpc": "2.0",
"method": "user.authenticate",
"params": {
"user": self.username,
"password": self.secret
},
"id": 1,
"auth": null
}
r =self.session.post(self.url, data= data)
POST returns this,
Traceback (most recent call last):
File "REST.API.py", line 60, in <module>
main()
File "REST.API.py", line 56, in main
restapi.authenticate()
File "REST.API.py", line 32, in authenticate
"auth": null
NameError: name 'null' is not defined
Any thoughts, ideas on what I am doing wrong?
thanks in advance,
defcreate_session(self):
self.session = requests.Session()
self.session.headers = {
'Content-Type' : 'application/json-rpc'
}
defauthenticate (self):
data = {
"jsonrpc": "2.0",
"method": "user.authenticate",
"params": {
"user": self.username,
"password": self.secret
},
"id": 1,
"auth": null
}
r =self.session.post(self.url, data= data)
POST returns this,
Traceback (most recent call last):
File "REST.API.py", line 60, in <module>
main()
File "REST.API.py", line 56, in main
restapi.authenticate()
File "REST.API.py", line 32, in authenticate
"auth": null
NameError: name 'null' is not defined
Any thoughts, ideas on what I am doing wrong?
thanks in advance,
Comment