GET Request to the Notion Database API throwing 401 status code #1657
-
Hi all! I'm working on a wasm rust app with Yew, and trying to retrieve database entries from Notion to fill the app's body content. I'm using reqwest to do all the http requesting part, but no matter what I do it keeps returning a 401 status code. I've tried the same request both on postman and curl and it works, so the bearer auth token and url should be correct. Here's what the code looks like:
I've tried logging NOTION_URL, NOTION_TOKEN, NOTION_VERSION env variables to be sure that they are correct, and they are. I've tried different things, like adding additional headers like accept or user-agent but the result is the same. Also tried to set the client's default headers with both the notion version and auth headers without success. My guess is that maybe the fetch_mode_no_cors() is the culprit, but without it the request doesn't even go through, and I can't find any alternative to this method. I'm kinda lost tbh, don't know where to find a solution so here we go! Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Turns out it's a bad idea to do this makenotion/notion-sdk-js#96 (comment) |
Beta Was this translation helpful? Give feedback.
Turns out it's a bad idea to do this makenotion/notion-sdk-js#96 (comment)
I'll maybe find a another way to do what I want!