react-crud-web-api icon indicating copy to clipboard operation
react-crud-web-api copied to clipboard

Header name should be properly capitalized (Content-Type)

Open vlad-ds opened this issue 2 years ago • 0 comments

https://github.com/bezkoder/react-crud-web-api/blob/8498b60d12cdbd7d3ada076fc5bb70a3eedc55e0/src/http-common.js#L6

Hi, thank you for your website and code!

I am following along with "axios": "^1.1.3". I just spent a painful 2 hours fighting a bug where the Axios service would always POST with an empty body. Thanks to Postman, I realized the header was not being read. It turns out it needs to be properly capitalized:

"Content-Type": "application/json"

And this fixed my issue.

vlad-ds avatar Oct 29 '22 19:10 vlad-ds