I got
No 'Access-Control-Allow-Origin' header is present
and the problem was with the URL I was providing. I was providing the URL without a route, e.g., https://misty-valley-1234.herokuapp.com/
.
When I added a path it worked, e.g.,
https://misty-valley-1234.herokuapp.com/messages
. With GET requests it worked either way but with POST responses it only worked with the added path.