# What's the correct \`content-type\` when editing posts?

**URL:** <https://meta.discourse.org/t/whats-the-correct-content-type-when-editing-posts/199921>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [August 10, 2021, 10:02am UTC](https://meta.discourse.org/t/whats-the-correct-content-type-when-editing-posts/199921 "2021-08-10T10:02:11Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)\
**Post date:** [August 10, 2021, 6:51pm UTC](https://meta.discourse.org/t/whats-the-correct-content-type-when-editing-posts/199921/7 "2021-08-10T18:51:51Z")

</div>

> [@pedroleaoc](#):
>
> The `PUT` request requires `"content-type": "application/x-www-form-urlencoded"`  
> The data is not in JSON (it’s encoded, although I don’t seem to find the right encoding)

Please see [my post](https://meta.discourse.org/t/whats-the-correct-content-type-when-editing-posts/199921/5) just above this. You can use the `json=data` instead of the `data=data` format in your request and the python requests library will take care of the content-type for you and will set it as `application/json` which is what you should be using.

---

_[View the full topic](https://meta.discourse.org/t/whats-the-correct-content-type-when-editing-posts/199921)._
