How to use the HTTP API For Supabase to GET / POST data and return records?
I am struggling to use the Supabase http api, and looking for some more detailed documentation — for example, the required headers for different types of requests. (It took me a long time of searching to realize that a 'PREFER' header is required to try and return a record while inserting, is there any official documentation for requirements like that?
As an example, in a Netlify function, I am trying to make a POST request work. When the function is structured like this:
It successfully creates a new record in the specified table, but returns an invalid response.
When I try this function instead, using the Prefer header
I get the following error, which doesn't appear when making the same http request just without the 'Prefer' header.
Can someone help me with some more detailed and simple code examples for the http api, such as
As an example, in a Netlify function, I am trying to make a POST request work. When the function is structured like this:
It successfully creates a new record in the specified table, but returns an invalid response.
When I try this function instead, using the Prefer header
I get the following error, which doesn't appear when making the same http request just without the 'Prefer' header.
Can someone help me with some more detailed and simple code examples for the http api, such as
inserting a record and returning the result, getting records from a table, getting records with a filter, and getting records with a foreign key reference included?