Discussions

Ask a Question
Back to All

Authenticating using REST - keep on getting the web page and not json

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)