# 500 internal server error when updating a post by id

**URL:** https://meta.discourse.org/t/500-internal-server-error-when-updating-a-post-by-id/389343
**Category:** Development
**Created:** [November 21, 2025, 3:35pm UTC](https://meta.discourse.org/t/500-internal-server-error-when-updating-a-post-by-id/389343 "2025-11-21T15:35:24Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![nordize](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@nordize](https://meta.discourse.org/u/nordize)
#### Post date: [November 21, 2025, 5:49pm UTC](https://meta.discourse.org/t/500-internal-server-error-when-updating-a-post-by-id/389343/2 "2025-11-21T17:49:40Z")

</div>

My apologies. Leaving this here just in case others find the same issue.

Debugging the actual HTTP request sent, I noticed that python was sending the PUT data as `"post=raw&post=edit_reason"` … replaced `data=data` with `json=data` in the `requests.put()` call and job done.

---

_[View the full topic](https://meta.discourse.org/t/500-internal-server-error-when-updating-a-post-by-id/389343)._
