You might need to have correct capitalization for your header keys. So ‘content-type’ needs to be changed to ‘Content-Type’. Same for ‘Content-Length’, but you probably don’t even need to specify that one.
blake
(Blake Erickson)
10
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Can't verify CSRF token authenticity while creating topics | 1 | 1257 | November 4, 2022 | |
| 'BAD CSRF' while creating a new post | 1 | 1947 | April 23, 2020 | |
| I'm getting bad CSRF error even after setting api keys and usernames to my headers | 2 | 945 | April 16, 2022 | |
| Create topic using Discourse API | 3 | 1152 | November 3, 2022 | |
| Getting ["BAD CSRF"] when updating topic via API [python] | 2 | 1123 | August 9, 2021 |