I'm having trouble connecting to the behance API. I registered my app, got my API key. And when I try it in my browser URL bar, everything works perfectly:
But whenever I try to fetch it via my app, it returns nothing (the body of the response is empty):
fetch(`https://api.behance.net/v2/projects?client_id=${API_KEY}`, {
mode: 'no-cors'
})
.then((res) => res.json())
.then((data) => {
console.log('DATA ', data)
})
Uncaught (in promise) SyntaxError: Unexpected end of input
at line 63 index.js
Line 63 corresponds to .then((res) => res.json())
which makes sense since the response is empty.
I also have this warning (Which I'm guessing comes from the fact that the response body is empty too):
Cross-Origin Read Blocking (CORB) blocked cross-origin response https://api.behance.net/v2/projects?per_page=25&client_id=[API_KEY] with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details.
Thanks in advance