I'm using the Supabase REST API and the following code to logout:
client = net.Http(api_url)
client.headers['Content-Type'] = 'application/json'
client.headers['apikey'] = api_key
client.headers['Authorization'] = 'Bearer '..access_token
task = client:post('auth/v1/logout')
local response, err = task:wait()
print(response, err)
I think this is functionally working and the logout is reported on Supabase server side.
My question is: the returned err value is nil and there is no apparent way to read the expected status code (204)
This specific API call is designed to not return any data + status = 204 in case of success.
How can I check if successful? Is checking for err = nil a good approach even if is Luart docs is usually considered as a failure?
Another point: the Http:delete() call requires a file argument, but in Supabase REST API there are DELETE calls without any body content. I solved this by passing a dummy temporary file but is not that elegant...,
Why not allowing the Luart Http:delete() API method to avoid to force a file argument?