我想使用content作为SPA的内容网关。我可以使用fetch中的概念API吗?我尝试使用fetch来获取数据,但由于CORS,它无法工作。
let notion = fetch(import.meta.env.VITE_NOTION_API_URL+'/databases/'+import.meta.env.VITE_NOTION_APP_DATABASE+'/query', {
method: 'POST',
mode: 'cors',
credentials: 'omit',
headers: {
'Content-Type': 'application/json',
"Authorization": `Bearer ${import.meta.env.VITE_NOTION_API_SECRET}`,
"Notion-Version": `${import.meta.env.VITE_NOTION_API_VERSION}`,
}
})这有可能吗?
发布于 2021-06-23 03:11:21
不是的。概念API不支持CORS。
https://stackoverflow.com/questions/68015381
复制相似问题