Back

Python sdk raises exception on document deletion

  • 0
  • Self Hosted
  • Databases
Iron
8 Mar, 2024, 12:45

I am trying to delete a document. this is the code:

TypeScript
database.delete_document(database_id, tag_collection_id, to_delete_id)

The document is deleted correctly, but the function throws the following exception: KeyError('content-type'). Digging into the sdk with a debugger, it looks like the response of the server does not include 'content-type' in the header, while the request library expects it to be there. Any idea why?

TL;DR
Developers facing KeyError('content-type') exception when deleting a document using Python SDK. SDK throws this error due to missing 'content-type' in the server response headers while the request library expects it. This mismatch causes the exception. To resolve, modify the library or response handling to accommodate this discrepancy.
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