I’m attempting to send a POST request to a Netlify website through a React Native app. The details of the request aren’t important, as it simply sends an email with the provided data.
The issue is that this works flawlessly on localhost. I have my site running on a development server locally, and the POST request goes through with ease. However, when I push the same code to Netlify, I get no response from the POST request. This is difficult to debug, as there are no error messages I can turn to.
For reference, my website code is taken from this Netlify Express Repo: https://github.com/neverendingqs/netlify-express with only a few modified lines.
The code for sending the POST request in my app is as follows:
fetch('https://livesantaclaus.com/api/email', {
method: "POST",
headers: {
'Accept': 'application/json, text/plain, */*',
'Content-Type': 'application/json'
},
body: JSON.stringify(body)
})
.catch(err => { })
Thank you so much for any help you can provide.
Netlify Site Name: https://livesantaclaus.netlify.app
Site name: https://www.livesantaclaus.com