Error 400 when sending auth info in Advanced HTTP Extension (solved)

I’m trying to use the Advanced HTTP Extension for communicating with supabase servers.

When trying to send a post request, I add headers for the jwt token.


However, whenever I try to send the request, I get Error Code 400 (Bad Request). I don’t know how to fix this, and the server doesn’t include additional details for the problem, and the extension also returns in the console “falseundefined”

Is there a way to fix this?
Thanks!

Looking at the cURL sample given in the supabase docs, it looks like apikey is supposed to be a header, not a query parameter?

# Append /rest/v1/ to your URL, and then use the table name as the route
curl '<SUPABASE_URL>/rest/v1/todos' \
-H "apikey: <SUPABASE_ANON_KEY>" \
-H "Authorization: Bearer <SUPABASE_ANON_KEY>"

I also tried it as a header before posting this, it’s there because it doesn’t really make a difference for me whether I put it there or not.

It still has the same results:

Do you know what is happening?

Can’t say I do, sorry :confused:
If UserLogInStuff.AccessToken is correct then the headers look right to me. Maybe the body, method, or endpoint are wrong? I do not know about supabase and their APIs, they might be expecting different inputs than what you are providing them :person_shrugging:

Just found out by using devtools in a web export content type was text/plain
I had to do a web export to debug this error.
Thanks for the support!

Edit: Do you know how to change content type? I don’t know how to use this behavior to use application/json as the content type to send.
Edit 2: I found it out. Now it works!