-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Fail to login with the REST API #11411
Description
I used the REST API to login, but the following error happened. I used wireshark to observe and although 200 is returned, not the json data, one html data is returned. I don't understand where the problem is.
File "D:/06_PythonProject/Test/RocketChat.py", line 19, in
main()
File "D:/06_PythonProject/Test/RocketChat.py", line 12, in main
rocket = RocketChat('XXXX', 'XXXXX', server_url='https://open.rocket.chat/home')
File "C:\Python27\lib\site-packages\rocketchat_API\rocketchat.py", line 21, in init
self.login(user, password)
File "C:\Python27\lib\site-packages\rocketchat_API\rocketchat.py", line 78, in login
if login_request.json().get('status') == "success":
File "C:\Python27\lib\site-packages\requests\models.py", line 896, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Python27\lib\json_init_.py", line 339, in loads
return _default_decoder.decode(s)
File "C:\Python27\lib\json\decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Python27\lib\json\decoder.py", line 382, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded