'I want to make a discord-webhook but getting this error all the time

Traceback (most recent call last): File "/Users/kova/Desktop/Discord.py", line 35, in response = webhook.execute() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/discord_webhook/webhook.py", line 408, in execute response = self.api_post_request(url) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/discord_webhook/webhook.py", line 374, in api_post_request response = requests.post( File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/requests/api.py", line 117, in post return request('post', url, data=data, json=json, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/requests/sessions.py", line 515, in request prep = self.prepare_request(req) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/requests/sessions.py", line 443, in prepare_request p.prepare( File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/requests/models.py", line 321, in prepare self.prepare_body(data, files, json) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/requests/models.py", line 473, in prepare_body body = complexjson.dumps(json, allow_nan=False) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/json/init.py", line 238, in dumps **kw).encode(obj) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/json/encoder.py", line 199, in encode chunks = self.iterencode(o, _one_shot=True) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/json/encoder.py", line 257, in iterencode return _iterencode(o, 0) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/json/encoder.py", line 179, in default raise TypeError(f'Object of type {o.class.name} ' TypeError: Object of type Tag is not JSON serializable



Solution 1:[1]

The actual error you get is TypeError: Object of type Tag is not JSON serializable Now, it is really hard to help you with this issue without a proper formatted traceback and without the code. The Error means, that the stuff you got as response from the API isn't json. As i said above already, I indeed can give you good help after you included the code and format the Code & Traceback correctly.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Toastlover