'BAD CSRF' while creating a new post

Change the key names that you are using in your request header to api-key and api-username. Header field names are not case sensitive, but underscores cannot be used in place of dashes. For an example of a properly formatted API request have a look at the example given at the start of this topic: Discourse API Documentation.

5 Likes