AttributeError:“ dict”对象没有属性“ url”

I'm writing some API tests in pytest which take in a user object which is generated from a utility class. Then it calls the requests library to make the required API calls.

Below is my code that tests the /user operations.

import requests

class users:
    def __init__(self, user):
        self.token = user["Token"]
        self.url = ''
        self.headers = {'token': self.token}

    def get_all_users(self):
        return requests.get(self.url, headers=self.headers).status_code

    def delete_user(self):
        return requests.delete(self.url, headers=self.headers).text

    def update_user(self):
        return, headers=self.headers).text


AttributeError: 'dict' object has no attribute 'url'

Am I unable to use self.url? I wanted to not have to redeclare it in each defination as the endpoint is the same for each test.