MAAS 2.5.2 API - Put Method - Invalid signature. Expected signature base string


I am trying to update a domain name on a machine by using the PUT endpoint of the API. I am wrapping everything in Python with the “Requests” module.

The code looks like this.

def set_machine_domain_name(maas_api_url, machine_id, maas_key, domain_name):
auth = get_maas_oauth_token(maas_key)
print(maas_api_url + “machines/” + machine_id + “/”)
r = requests.put(maas_api_url + “machines/” + machine_id + “/”,
data={‘domain’: domain_name

I can use the very same url for a POST/GET without any issues so I know that the URL is valid. Is there anything different in how MAAS handles a PUT request?