Discussions
Authenticating using REST - keep on getting the web page and not json
almost 7 years ago by Greg Small
This code we're using in Python 3.6 will not give us any json or token, just the html of the api web page as the content of the response:
import requests
url = "https://www.humanity.com/api/"
auth = """ {
"key": "apikey",
"module": "staff.login",
"method": "GET",
"username": "user",
"password": "password"
} """
resp = requests.get(url, auth)
print(resp.content)