# Improve BAD CSRF error message when making API calls with content-type application/json

**URL:** https://meta.discourse.org/t/improve-bad-csrf-error-message-when-making-api-calls-with-content-type-application-json/117136
**Category:** Development
**Created:** [May 8, 2019, 1:14am UTC](https://meta.discourse.org/t/improve-bad-csrf-error-message-when-making-api-calls-with-content-type-application-json/117136 "2019-05-08T01:14:42Z")
**Posts on this page:** 1
**Showing post:** 4

<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: [May 13, 2019, 7:10pm UTC](https://meta.discourse.org/t/improve-bad-csrf-error-message-when-making-api-calls-with-content-type-application-json/117136/4 "2019-05-13T19:10:21Z")

</div>

Can you share with me your actual ruby code to make this request? I’m unable to reproduce this locally. Here is the Postman json call I’m making and I’m always getting a response back:

 ![image](https://global.discourse-cdn.com/meta/original/3X/0/f/0f3b7a1508e31a50bd1c6fac36fb37efb1eba58f.png)

 ![image](https://global.discourse-cdn.com/meta/original/3X/1/c/1c33179e45605bb34c4ea92e199b2f37144643ab.png)

Also I don’t think you need the extra `post["raw"]` parameter.

`Parameters: {"title"=>"RT @love_se4: One of those hidden gems in the local community, you just have to try. Over 170 different gins. Proper mixologists who know h…", "raw"=>"https://twitter.com/se23_tweets/status/1127663613412630529", "category"=>49, "post"=>{"raw"=>"https://twitter.com/se23_tweets/status/1127663613412630529"}}`

---

_[View the full topic](https://meta.discourse.org/t/improve-bad-csrf-error-message-when-making-api-calls-with-content-type-application-json/117136)._
