Skip to content
Back

Python SDK: appwrite.exception.AppwriteException: request cannot have request body

  • 0
  • Storage
rc_william
15 Apr, 2025, 23:20

I am getting the same error in appwrite python sdk calling either of storage.list_buckets() or storage.get_bucket(bucket_id='<bucket_id>').

Traceback (most recent call last): File "/images/main.py", line 13, in <module> main() ~~~~^^ File "/images/main.py", line 9, in main result = storage.list_buckets() File "/usr/local/lib/python3.13/site-packages/appwrite/services/storage.py", line 42, in list_buckets return self.client.call('get', api_path, { ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^ 'content-type': 'application/json', ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ }, api_params) ^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/appwrite/client.py", line 137, in call raise AppwriteException(response.text, response.status_code, None, response.text) appwrite.exception.AppwriteException: request cannot have request body

using appwrite==9.0.3

I think the line in client.py that assigns data={} for all requests might be the reason for the error. But open to ideas and solutions

TL;DR
Developers are encountering the 'request cannot have request body' error when using certain functions in the Python SDK for Appwrite. This issue seems to arise from the `data={}` assignment in the client.py file. One developer noted they did not face this error with version 9.0.3 and requested the code snippet showing the call.
ZachHandley
15 Apr, 2025, 23:32

oh you did make a new request

ZachHandley
15 Apr, 2025, 23:32

I am using 9.0.3 and I do not have this issue, can you show the code that calls it instead of just the error?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more