I’m trying to figure out how netlify function callback works. Since the deploy api returns a CORS error if called from the frontend (browser), i decided to use Netlify functions. The site is created successfully, here’s my code:
fetch('https://api.netlify.com/api/v1/sites', {
method: 'POST',
headers: {
'Content-Type': 'application/zip',
Authorization: 'Bearer ' + 'Auth'
},
data: 'myfile.zip',
})
However, I’m getting an empty response, instead of the site id and other values.
Please let me know if you need more information